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/gawk -f | |
BEGIN { | |
RS="(\"*[[:alnum:]*]\"[ \t]*:[ \t]*)?\"*[ \t]*(,|{)+[ \t]*|\n[ \t]+\"|(\"[[:alnum:]*]\"[ \t]*:[ \t]*)?{|\"+[\n]+"; | |
FS="\"[ \t]*:[ \t]*|\"?[ \t]*:[ \t]*\""; | |
column_format ="| %-39s"; | |
cols = 0; rows = 0; |
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
hash nvm 2>/dev/null | |
if [ "$?" == "1" ]; then | |
if [ -f "$HOME/.nvm/nvm.sh" ]; then | |
. $HOME/.nvm/nvm.sh | |
if [ -f "$HOME/.nvm/bash_completion" ]; then | |
. $HOME/.nvm/bash_completion | |
fi | |
fi | |
fi |
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
api.all('*', function(req, res, next){ | |
if (!req.get('Origin')) return next(); | |
// use "*" here to accept any origin | |
res.set('Access-Control-Allow-Origin', 'http://localhost:3000'); | |
res.set('Access-Control-Allow-Methods', 'GET, POST'); | |
res.set('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type'); | |
// res.set('Access-Control-Allow-Max-Age', 3600); | |
if ('OPTIONS' == req.method) return res.send(200); | |
next(); |
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
class SomeAjaxCallback | |
constructor: (@value) -> | |
throw "Bad value" unless value? | |
setTimeout @process, 5000 | |
# setTimeout doesn't give us a "new context" | |
# so we'd get our "global context" : window. | |
# let's avoid that using the fat arrow. | |
process: => | |
throw "Wrong context" unless @value? |
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
# **** | |
# Needs to be before the optional dependency | |
# **** | |
optional = (name) -> | |
try | |
require name | |
catch err | |
console.log " * optional dependency not found: #{name}" | |
false |
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
var gulp = require('gulp'); | |
var npm = require("npm"); | |
var pkg = require("./package.json") | |
gulp.task('default', [], function(cb){ | |
npm.load(pkg, function (er, npm) { | |
// npm.config.set('global', true); | |
npm.commands.update([],cb); | |
}); | |
}); |
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
bower install -V |& progress |
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 bash | |
find /tmp -maxdepth 1 -type f -uid $(id -u) -name "*err*.log" -delete |
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 bash | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
[[ -f "$DIR/colors.tput.sh" ]] && { | |
source "$DIR/colors.tput.sh" | |
} || { | |
echo "Unable to find file: $DIR/colors.tput.sh" | |
exit 1 | |
} | |
reset="$(color)" |
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
"use strict"; | |
angular.module("MyApp.services"/*, []*/) | |
.constant('piwikUrl', 'http://0.0.0.0/piwik') | |
.constant('piwikAuthToken', '0a0a00a0aa0a00000a00aaa0000a0a0') | |
.constant('piwikSiteUrl', 'http://myapp.mydomain.com') | |
.constant('piwikSiteName', 'MyApp') | |
.service('piwik', ['$q', '$http', 'piwikUrl', 'piwikAuthToken', 'piwikSiteUrl', 'piwikSiteName', | |
function($q, $http, piwikUrl, piwikAuthToken, piwikSiteUrl, piwikSiteName) { | |
function fetchSiteIds (){ | |
var deferred = $q.defer(); |
OlderNewer