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
// 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 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
(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 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
egrep '\b(version|name)\b' package.json | cut -d\ -f4- | awk 1 ORS=' ' | sed 's/[",]//g; s/[ ]/-/; s/[ ]//' |
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
\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 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
(function() { | |
'use strict'; | |
/* global angular */ | |
var app = angular.module('bidos', [ | |
'ngCordova' | |
]); | |
app.controller('appCtrl', [function() { |
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 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 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
# Move current working directory to current date %H%M%S like ../005347 | |
mvPwdToDate () { | |
dir=../$(zstat -F '%H%M%S' +ctime $PWD) | |
mkdir -p $dir && mv -iv $PWD $dir && cd . | |
} |
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
#!/bin/zsh | |
#vi: colorscheme delek | |
# | |
# beware | |
# 2012,2015 (c) [email protected] | |
# | |
if [ ! $#@ -eq 1 ] | |
then |
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
${1/(.*)/\u$1/} |
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
<link rel="import" href="../polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |