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 R = 6371; // km | |
var φ1 = lat1.toRadians(); | |
var φ2 = lat2.toRadians(); | |
var Δφ = (lat2-lat1).toRadians(); | |
var Δλ = (lon2-lon1).toRadians(); | |
var a = Math.sin(Δφ/2) * Math.sin(Δφ/2) + | |
Math.cos(φ1) * Math.cos(φ2) * | |
Math.sin(Δλ/2) * Math.sin(Δλ/2); | |
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); |
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 | |
idletime=$((1000*60*5)) # 5 minutes in milliseconds | |
idleMessageSent=0 | |
while true; do | |
idle=`xprintidle` | |
if [[ "$idle" -gt "$idletime" ]]; then | |
if [[ "$idleMessageSent" -eq 0 ]]; then | |
if (gnome-screensaver-command -q | grep "is active"); then |
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
function reloadCSS() { | |
var d = (new Date()).getTime(); | |
$('link[rel=stylesheet]').each(function (i, el) { | |
var href = $(el).attr('href'); | |
if (href.indexOf('?') === -1) { | |
href += '?_=' + d; | |
} else { | |
if (href.indexOf('_=') === -1) { | |
href += '&_=' + d; | |
} else { |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
angular.module("filters", []) | |
.filter('round', function () { | |
return function (input, precision) { | |
return input ? parseFloat(input).toFixed(precision) : ""; | |
}; | |
}) | |
.filter('dollars', function () { | |
return function (input) { | |
return input ? '$' + input : '' | |
}; |
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 String makeMessageStr(HashMap<String, String> messageHash) { | |
String from_number = messageHash.get("from_number"); | |
Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(from_number)); | |
Cursor people = getContentResolver().query(uri, new String[]{ContactsContract.PhoneLookup.DISPLAY_NAME}, null, null, null); | |
int indexName = people.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME); | |
String name = from_number; | |
if (people.getCount() > 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
do_dlog = true | |
true | |
0 1393615541391 "running pw_to_login" sitewide-js.js:30922 | |
0 1393615555212 "about to pw_to_pwh" sitewide-js.js:36881 | |
53230 1393615608442 "about to getsalt" |
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
do_dlog = true | |
true | |
window.navigator.userAgent | |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36" | |
0 1393609938310 "running pw_to_login" sitewide-js.js:30922 | |
0 1393609938311 "about to pw_to_pwh" sitewide-js.js:36881 | |
0 1393609938312 "about to getsalt" sitewide-js.js:36881 | |
192 1393609938504 "done getting salt" sitewide-js.js:36881 | |
0 1393609938505 "about to scrypt_hash_passphrase" sitewide-js.js:36881 | |
99 1393609938604 Object {what: "pbkdf2 (pass 1)", total: 32, i: 0} sitewide-js.js:36881 |
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 | |
if [ -n $VIRTUAL_ENV ]; then | |
PATH=$VIRTUAL_ENV/bin:$PATH | |
fi | |
REPO=$(pwd) | |
EXIT_CODE=0 | |
for FILE in `git diff-index --name-only --cached HEAD -- | egrep .js$`; do |
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
09:47 < ghost[]> ghosts aren't undead! | |
09:47 < ghost[]> they're just dead | |
09:50 < Lydia_K> Yeah, I think they are just dead | |
09:52 < huf> undead doesnt necessarily mean "died and rose again" | |
09:53 < huf> could mean "life extended beyond natural means by evil trickery" or some shit | |
09:53 < huf> (the lord of the nazgul was undead, but hadnt died even once (prior to the eowyn fiasco)) |