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
//TODO: make this a module | |
/** | |
* # SockJS socket management service | |
* | |
* Creates SockJS socket connection to server, re-connects on disconnection, | |
* and exports hooks to map handlers for various data interactions. | |
* | |
*/ | |
angular.module('app').factory |
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
// MIT: http://opensource.org/licenses/MIT | |
angular.module('app', []); | |
angular.module('app').controller | |
( 'MainCtrl' | |
, function($scope,$locale) { | |
$scope.currentYear = new Date().getFullYear() | |
$scope.currentMonth = new Date().getMonth() + 1 | |
$scope.months = $locale.DATETIME_FORMATS.MONTH |
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
var assert = require("assert") | |
var pigLatinTrans = function(text){ | |
var pigText = text.replace(/[A-Za-z]+/gi,function(word){ | |
var letters = word.split('') | |
var firstLetter = letters.shift() | |
if (firstLetter.toUpperCase() == firstLetter){ | |
letters.push(firstLetter.toLowerCase()) | |
letters[0] = letters[0].toUpperCase() | |
letters.push(firstLetter) |
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/bash | |
USER='lrvick' | |
ACCESS_TOKEN='YOUR_TOKEN_HERE' | |
API="https://api.github.com/orgs" | |
ENDPOINT="/${USER}/repos?per_page=200&access_token=${ACCESS_TOKEN}" | |
FOLDER='/home/lrvick/Sources' | |
REPO_NAMES=$( curl -s "${API}${ENDPOINT}" | \ | |
grep \"name\" | sed 's/ \"name\": \"\(.*\)\",/\1/g' |
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
# If IOS7 sees a *.appcache file it freaks out and disables browser | |
# history until browser cache is cleared AND it is rebooted. | |
# Tell IOS7 users asking for a *.appcache file to GTFO with a 412 | |
# "precondition failed" response so they don't hurt themselves. | |
if ( $http_user_agent ~* '(iPad|iPhone);.*CPU.*OS 7_' ){ | |
set $test IOS7; | |
} | |
if ($request_filename ~* ^.+.appcache$) { | |
set $test "${test}_APPCACHE"; | |
} |
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
# Convert GET access_token to Cookie to avoid Referrer leaks. | |
location / { | |
if ($request_uri ~ (.*[\?&])access_token=[^&]*&?(.*)){ | |
add_header Set-Cookie access_token=$arg_access_token;secure;HttpOnly | |
return 301 $1$2; | |
} | |
} |
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
#Get latest debian image | |
FROM debian:wheezy | |
RUN echo "deb http://nginx.org/packages/debian/ wheezy nginx" >> /etc/apt/sources.list.d/nginx.list | |
RUN apt-key adv --fetch-keys "http://nginx.org/keys/nginx_signing.key" | |
# Update package repos | |
RUN apt-get update -y --fix-missing | |
RUN apt-get upgrade -y --fix-missing |
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
var twilioNumber = '+19252414543'; | |
var twilioSID = 'Your twilio account SID'; | |
var twilioToken = 'Your twilio auth tokenn' | |
var client = require('twilio')(twilioSID,twilioToken); | |
var sendSMS = function(number,message){ | |
client.sms.messages.post({ | |
to:twilioNumber, | |
from:fromNumber, |
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
FROM abh1nav/java7 | |
# Download and extract Cassandra | |
RUN \ | |
mkdir /opt/cassandra; \ | |
wget -O - http://www.us.apache.org/dist/cassandra/2.1.2/apache-cassandra-2.1.2-bin.tar.gz \ | |
| tar xzf - --strip-components=1 -C "/opt/cassandra"; | |
ADD cassandra.yaml /opt/cassandra/conf/ | |
ADD run.sh /tmp/ |
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
<html> | |
<body> | |
<a href="#" onclick="die()">click me!</a> | |
<script> | |
function die () { | |
setTimeout(function () {die(); die()}, 0) | |
} | |
</script> | |
</body> | |
</html> |