I hereby claim:
- I am antonagestam on github.
- I am antonagestam (https://keybase.io/antonagestam) on keybase.
- I have a public key ASAlMX3lP7UfVfGXWkM1XC13pab0Uy3TSbaDmtfzl0-brgo
To claim this, I am signing this object:
| from https://twitter.com/Viss/status/809168960495063040 | |
| $ brew install Caskroom/cask/qlstephen | |
| $ defaults write com.apple.finder QLEnableTextSelection -bool TRUE | |
| $ killall Finder | |
| $ brew install Caskroom/cask/qlcolorcode | |
| $ qlmanage -r |
I hereby claim:
To claim this, I am signing this object:
| cmake_minimum_required(VERSION 3.2) | |
| project(YourProject) | |
| add_subdirectory(src) | |
| add_subdirectory(lib) |
| # Extend builtin cd function to automatically activate virtual env of | |
| # current directory. | |
| function cd(){ | |
| builtin cd "$@" | |
| if [[ -e .oncd ]]; | |
| then | |
| echo "Found .oncd ..." | |
| source .oncd | |
| fi |
| /bin/bash | |
| osascript -e 'open location "x-onepassword-helper://search/{query}"' |
| #!/usr/bin/env bash | |
| # Run a process and make sure it is not running concurrently. If it is already | |
| # running, then refuse to run it and exit | |
| if [[ ! -z ${4+x} || -z ${3+x} ]]; then | |
| echo "" | |
| echo "Error: Unexpected arguments" | |
| echo "" | |
| echo "usage: $0 <pidfile> <logfile> \"<cmd>\"" |
| /* | |
| A slightly more condensed version of https://esdiscuss.org/topic/promises-async-functions-and-requestanimationframe-together | |
| */ | |
| let animation_frame = () => new Promise(window.requestAnimationFrame); | |
| (async () => { | |
| while (true) { | |
| await animation_frame(); | |
| // draw | |
| } |
| #!/usr/bin/env bash | |
| # The logging functions all take input both as arguments and as stdin so that | |
| # logging can be piped from other commands. The commands use this themselves: | |
| # `log_sub` pipes into `log` which pipes into `prefix`. | |
| prefix () { | |
| local replace="s/^/$1/" | |
| if (( $# > 1 )); then |
| get_lock () { | |
| # get_lock assures only one process of a kind can be active at a time. It | |
| # takes a path to a lockfile as its first argument and the number of seconds | |
| # to let processes run for as its second argument. Use release_lock to | |
| # remove the lockfile. | |
| # | |
| # To get an infinite lock, pass "infinite" as the locktime argument. This | |
| # makes processes trying to acquire locks exit immediately if one already | |
| # exists. |
| from collections import namedtuple | |
| from aiomysql.cursors import Cursor, SSCursor | |
| class _NamedTupleCursorMixin: | |
| async def _do_get_result(self): | |
| await super()._do_get_result() | |
| fields = [] | |
| if self._description: | |
| for f in self._result.fields: |