- strip beginning/ending single or double quotes
^([^:]*): (?:["'])?(.*?)(?:["'])?$
$1: $2
- replace quotes around KEYS with placeholders, if the key has quotes, preserve indents
class Manifest < ApplicationRecord | |
def self.item_ids(id, keyword=nil, prefix=nil) | |
cases = Arel::Table.new(:manifest_items) | |
casequery = cases.where(cases[:manifest_id].eq(id)) | |
if keyword | |
# "keywords" is an string array column in the database, so I want to generate | |
# "'#{keyword}' = ANY(keywords)", essentially, with correct quoting/escaping |
-- reference: https://github.com/datachomp/dotfiles/blob/master/.psqlrc | |
\set QUIET 1 | |
-- formatting | |
\x auto | |
\set VERBOSITY verbose | |
\set ON_ERROR_ROLLBACK interactive | |
-- show execution times | |
\timing |
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo '' && echo 'Please also provide server name as in config file...' && | |
exit 1 | |
fi | |
retries=0 | |
repeat=true | |
today=$(date) |
log() { | |
while IFS= read -r line; do | |
# prepend timestamp, first argument/second argument, and then input line | |
echo "[$(date -u +'%Y-%m-%d %H:%M:%S,%3N') $1/$2] $line" | |
done | |
} |
^([^:]*): (?:["'])?(.*?)(?:["'])?$
$1: $2
pip install --pre praw
python flair_import.py
[color] | |
ui = auto | |
diff = auto | |
status = auto | |
branch = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] |
I hereby claim:
To claim this, I am signing this object:
https://github.com/diafygi/acme-tiny
make sure permissions are such that deploy user does not have access to domain.key
# translation to python for grasshopper | |
# original: https://gist.github.com/mbostock/22fd67be72552774736d | |
# import pdb | |
import numpy | |
def poissonDiscSampler(width, height, radius): | |
k = 30 # maximum number of samples before rejection | |
radius2 = radius * radius | |
R = 3 * radius2 |