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'; | |
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var del = require('del'); | |
var uglify = require('gulp-uglify'); | |
var gulpif = require('gulp-if'); | |
var exec = require('child_process').exec; | |
var notify = require('gulp-notify'); |
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
#! /bin/bash | |
# download jq from http://stedolan.github.io/jq/ | |
IAM_CREDS=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/[iam-role] 2>/dev/null` | |
export AWS_ACCESS_KEY_ID=`echo $IAM_CREDS | jq .AccessKeyId | sed -e 's/^"//' -e 's/"$//'` | |
export AWS_SECRET_ACCESS_KEY=`echo $IAM_CREDS | jq .SecretAccessKey | sed -e 's/^"//' -e '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
(ns meow.alerts | |
(:require [clojure.stacktrace :refer [print-stack-trace]])) | |
(defmacro safely [body] | |
`(try ~body | |
(catch java.lang.Throwable e# | |
(println "Caught exception while trying to report a problem:" (.getMessage e#)) | |
(print-stack-trace e#)))) | |
(defn init! [sms-send server] |
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 node | |
'use strict'; | |
var http = require('http'); | |
var listenPort = process.argv[2]; | |
if (listenPort == undefined || isNaN(listenPort)) throw new Error('No valid port number specified. Usage: httpsRedirect [portToListenOn]'); |
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
private static void startHttpsRedirector() throws IOException { | |
org.simpleframework.http.core.Container container = new org.simpleframework.http.core.Container() { | |
@Override | |
public void handle(Request request, Response response) { | |
Path path = request.getPath(); | |
Query query = request.getQuery(); | |
String rawHost = request.getValue("host"); | |
System.out.println("Raw host: " + rawHost); | |
System.out.println("Raw path: " + path); |
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
// for the origina blog post check | |
// http://www.markhneedham.com/blog/2011/09/25/jquery-collecting-the-results-from-a-collection-of-asynchronous-requests/ | |
var people = ["Marc", "Liz", "Ken", "Duncan", "Uday", "Mark", "Charles"]; | |
asyncLoop(people, [], function(name, grid, callBackFn) { | |
// parse data and create something cool | |
grid.push(somethingCool); | |
callBackFn(); | |
}, function(grid) { | |
// do something with grid |