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> | |
<head> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery-1.8.0.min.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
function doCall(){ | |
$.get('foo').error(function(){ | |
parent.afterCall(); | |
}); |
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
# ends up at 127.0.0.1:8080 | |
location /bla/ { | |
rewrite ^/bla/(.*) $1 break; | |
proxy_pass http://127.0.0.1:8080/; | |
} | |
# doesnt end up at 127.0.0.1:8080/woo | |
location /bla/ { | |
rewrite ^/bla/(.*) $1 break; |
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
<!-- for using mocked data while testing --> | |
<script type="text/javascript" src="../test/lib/angular/angular-mocks.js"></script> | |
<script type="text/javascript" src="../test/e2e/mocks.js"></script> |
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
<!-- for using mocked data while testing --> | |
<script type="text/javascript" src="../test/lib/angular/angular-mocks.js"></script> | |
<script type="text/javascript" src="../test/e2e/mocks.js"></script> |
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 | |
MSG=`sudo apt-get --yes dist-upgrade` | |
MSG_HEADING='sudo apt-get --yes dist-upgrade' | |
GmailSend.py -u [email protected] -p bla -t [email protected] -s "server update" -b "$MSG_HEADING \n\n $MSG" |
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
describe('underscore', function(){ | |
it('shouldnt execute immediately', function(){ | |
var hasHappened = false; | |
var fn = underscore.debounce(function(){ | |
hasHappened = true; | |
}, 100); | |
expect(hasHappened).toBe(false); |
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
package com.stephenn.roguelike.util | |
import javax.imageio.ImageIO | |
import java.io.File | |
import java.awt.image.BufferedImage | |
object SpriteSplitter { | |
def main(args: Array[String]) { | |
val sprites = split(loadImage("assets/nethack-3.4.3-32x32.png"), 1280/32, 960/32) |
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 | |
# | |
# Notify of Homebrew updates via Notification Center on Mac OS X | |
# | |
# Author: Chris Streeter http://www.chrisstreeter.com | |
# Requires: terminal-notifier. Install with: | |
# brew install terminal-notifier | |
TERM_APP='/Applications/Terminal.app' | |
BREW_EXEC='/usr/local/bin/brew' |
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 | |
ps aux | grep java | |
for PID in `pidof java` | |
do | |
echo | |
echo "jmap -heap $PID" | |
jmap -heap $PID | |
done |
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
import play.api.libs.ws._ | |
def get(url: String): Future[WSResponse] = { | |
val split = url.split("/") | |
val hostname = split(0) | |
val path = "/"+split(1) | |
def getHosts = Try(InetAddress.getAllByName(hostname).map(_.getHostAddress).toSeq) | |
def executeRecovering(triedHosts: Seq[String] = Nil): Future[WSResponse] = { |
OlderNewer