Rust has many postfix combinators, for example the
.unwrap_or(x) and .unwrap_or_else(|| x) functions.
They are useful if you want to extract some value from
an optionally present value, or if not, provide an
alternative value. It's really nice and tidy to read:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Instructions for gitlab are yet to come. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import os | |
| import json | |
| import random | |
| import zipfile | |
| config = { | |
| "color": "red", | |
| "amount": 42.24, |
This was tested on MacOS 10.14.5 on 2019-07-16
schemacrawler is a free and open-source database schema discovery and comprehension tool. It can be invoked from the command-line to produce, using GraphViz, images/pdfs from a SQLite (or other database type) file. It can be used from the command-line to generate schema diagrams like these:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import os | |
| import json | |
| import random | |
| import zipfile | |
| config = { | |
| "color": "red", | |
| "amount": 42.24, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Filename: /etc/zsh/zshrc | |
| # Purpose: config file for zsh (z shell) | |
| # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org> | |
| # Bug-Reports: see http://grml.org/bugs/ | |
| # License: This file is licensed under the GPL v2. | |
| ################################################################################ | |
| # This file is sourced only for interactive shells. It | |
| # should contain commands to set up aliases, functions, | |
| # options, key bindings, etc. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import lru_cache | |
| from datetime import datetime | |
| @lru_cache(maxsize=None) | |
| def fib_cache(n): | |
| if n < 2: | |
| return n | |
| return fib_cache(n-1) + fib_cache(n-2) | |
| def fib_no_cache(n): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # _____ __ __ | |
| # |__ / / /__ ____ _____ ____ ____/ / | |
| # /_ <______/ / _ \/ __ `/ __ `/ _ \/ __ / | |
| # ___/ /_____/ / __/ /_/ / /_/ / __/ /_/ / | |
| # /____/ /_/\___/\__, /\__, /\___/\__,_/ | |
| # /____//____/ | |
| # RTWEET + 3-LEGGED-AUTH DEMO (LITE) | |
| # This code demonstrates how to do 3-legged authentication for Twitter | |
| # using the {rtweet} package. Based heavily on code from Michael Kearney. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://hakibenita.com/fast-load-data-python-postgresql | |
| from typing import Iterator, Dict, Any, Optional | |
| from urllib.parse import urlencode | |
| import datetime | |
| #------------------------ Profile | |
| import time |
NewerOlder
