This file contains 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 zsh | |
# generate build/manifest.appcache | |
client=($(find client -type f)) | |
build=($(find build -type f)) | |
bower=($(grep -Ehor 'lib/.[a-zA-Z0-9/\._-]+' client | grep '\.')) | |
remote=($(grep -Ehor 'http[s]/[a-zA-Z0-9/\._-]+' client)) | |
cached_files=($client $build $bower $remote) |
This file contains 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
(function() { | |
'use strict'; | |
/* global angular */ | |
var app = angular.module('bidos', [ | |
'ngCordova' | |
]); | |
app.controller('appCtrl', [function() { |
This file contains 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
\set QUIET 1 | |
\pset format wrapped | |
\pset null '' | |
\pset pager on | |
\set COMP_KEYWORD_CASE upper | |
\set extensions 'select * from pg_available_extensions;' | |
\set HISTSIZE 9999 | |
\set PROMPT1 '%[%033[1;31m%]psql%[%033[0m%]:%[%033[1;33m%]%/ %[%033[1;35m%]>%[%033[0m%] ' | |
\set PROMPT2 '%[%033[1;31m%]> %[%033[0m%] ' | |
\set show_slow_queries 'SELECT (total_time / 1000 / 60) as total_minutes, (total_time/calls) as average_time, query FROM pg_stat_statements ORDER BY 1 DESC LIMIT 100;' |
This file contains 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
egrep '\b(version|name)\b' package.json | cut -d\ -f4- | awk 1 ORS=' ' | sed 's/[",]//g; s/[ ]/-/; s/[ ]//' |
This file contains 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
(function() { | |
//jshint esnext:true | |
'use strict'; | |
var koa = require('koa'); | |
var cors = require('koa-cors'); | |
var pg = require('koa-pg'); | |
var app = koa(); | |
var DATABASE = process.env.DATABASE || 'postgres://asdsf@localhost/database'; |
This file contains 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
// jshint esnext:true | |
function linkResources(data) { | |
_.each(data, function(resources, _key) { | |
let key = _key; | |
_.each(resources, function(resource, resourceIdx, resources) { | |
var refs = _.pick(resource, function(refId, refKey) { | |
return /_id/.test(refKey) && refId; | |
}); |
This file contains 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
gpg-export-my-key() { | |
gpg --armor --export $EMAIL | |
} | |
gpg-encrypt-eof() { | |
cat << EOF | gpg --encrypt --armor -r $EMAIL | curl -sF 'f:1=<-' ix.io | pbcopy | |
} | |
gpg-decrypt-paste() { | |
pbpaste | gpg --decrypt |
This file contains 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
<!-- | |
OS X launchd plist: Copy to ~/Library/LaunchAgents | |
and launch with launchctl load ~/Library/LaunchAgents/org.asdflabs.screenbla.plist. | |
Make sure the path to the shell script is correct. | |
--> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> |
This file contains 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
LAUNCH_DAEMONS = /System/Library/LaunchDaemons | |
MDNSRESPONDER = com.apple.mDNSResponder.plist | |
MDNSRESPONDER_HELPER = com.apple.mDNSResponderHelper.plist | |
DISCOVERYD = com.apple.discoveryd.plist | |
DISCOVERYD_HELPER = com.apple.discoveryd_helper.plist | |
install: copy-files unload-discoveryd load-mDNSResponder | |
uninstall: unload-mDNSResponder load-discoveryd remove-files | |
clear-caches: clear-mdns-cache clear-udns-cache | |
reload-discoveryd: unload-discoveryd load-discoveryd |
This file contains 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/local/bin/zsh -e | |
# Fri Mar 20 03:01:41 CET 2015 | |
# [email protected] (c) MMXV | |
zmodload -F zsh/stat b:zstat | |
test `which lolcat` && alias -g RAINBOW="|lolcat" || alias -g RAINBOW="" | |
test ! $BACKUPDIR && BACKUPDIR=backups | |
echo -e "\e[1;37mcreating backups ...\e[0m" | |
for f in $@; do | |
backupdir=$BACKUPDIR/`zstat -F '%Y/%m/%d' +mtime -- $f` | |
backupfile=$backupdir/$f.`date +%Y%m%d`.tar.bz |