View file.sh
python -c "import csv,json,fileinput;print(json.dumps(list(csv.DictReader(fileinput.input()))))" file.csv |
View INSTALL.sh
# open https://console.cloud.google.com/home/dashboard?cloudshell=true | |
PROJECT_ID=go-read-123456 | |
gcloud projects create $PROJECT_ID | |
gcloud app create --project=$PROJECT_ID | |
goapp get -d github.com/mjibson/goread | |
cd ~/gopath/src/github.com/mjibson/goread/app/ | |
sed s/go-read/$PROJECT_ID/ app.sample.yaml >app.yaml | |
cp ../settings.go.dist ../settings.go | |
goapp deploy |
View postgres.sh
#!/bin/bash | |
set -euo pipefail | |
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem | |
openssl rsa -in privkey.pem -passin pass:abcd -out server.key | |
openssl req -x509 -in server.req -text -key server.key -out server.crt | |
chmod 600 server.key | |
test $(uname -s) == Linux && chown 70 server.key | |
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key |
View .dockerignore
* | |
!install.sh |
View package.json
{ | |
"dependencies": { | |
"moment": "^2.12.0", | |
"request": "^2.70.0", | |
"underscore": "^1.8.3" | |
} | |
} |
View mailx.sh
#!/bin/bash | |
set -eu -o pipefail | |
cmd="curl -s --user 'api:$MAILGUN_API_KEY' https://api.mailgun.net/v2/$MAILGUN_DOMAIN/messages" | |
while getopts "r:c:b:s:a:E" opt; do | |
case $opt in | |
r) | |
cmd+=" -F from='$OPTARG'" | |
;; |
View package.json
{ | |
"dependencies": { | |
"underscore": "^1.8.3", | |
"vorpal": "^1.4.0", | |
"ws": "^0.8.1" | |
} | |
} |
View gist:b12531d1a8df25f6c170
jq -r '["List", "Card"], ((reduce .lists[] as $list ({}; .[$list.id] = $list.name)) as $lists | .cards[] | select(.closed != true) | [$lists[.idList],.name]) | @csv' <nw3RUeLl.json |
View index.js
function hash(object, algorithm, encoding) { | |
var h = require('crypto').createHash(algorithm || 'md5'); | |
(function update(v, k) { | |
if (k !== undefined) { | |
h.update(JSON.stringify(k)); | |
} | |
if (v && v.constructor === Array) { | |
v.forEach(function(value) { | |
update(h, value); | |
}); |
View blog.xml
--- | |
--- | |
<feed xmlns="http://www.w3.org/2005/Atom"> | |
<title>{{site.title}}</title> | |
<id>http://{{site.domain}}/</id> | |
<updated>{{site.time | date_to_xmlschema}}</updated> | |
<link href="http://{{site.domain}}/blog.xml" rel="self"/> | |
{% for post in site.posts %} |
NewerOlder