I hereby claim:
- I am tlivings on github.
- I am tlivings (https://keybase.io/tlivings) on keybase.
- I have a public key whose fingerprint is E48C BB26 792C 4030 552B 0DC0 CBE2 A2AD E973 A9BD
To claim this, I am signing this object:
var anvil = require('anvil'), | |
bignum = require('bignum'), | |
bn = require('bn.js'); | |
anvil('Bignum functions', function (forge, hammer) { | |
var bigBuffer, bigString; | |
bigBuffer = new Buffer([ 24, 7, 144, 87, 61, 194, 2, 7 ]); | |
bigString = '1731511286119924231'; |
'use strict'; | |
function Trie() { | |
this.children = {}; | |
} | |
Trie.prototype = { | |
search: function (str) { | |
var current = this; |
I hereby claim:
To claim this, I am signing this object:
- (void) authenticateLocalPlayer { | |
GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; | |
[localPlayer authenticateWithCompletionHandler:^(NSError *error) { | |
if (localPlayer.isAuthenticated) { | |
//Maybe do something | |
} | |
}]; | |
} |
var scripts = document.getElementsByTagName('script'); | |
var myScript = scripts[ scripts.length - 1 ]; | |
var queryString = myScript.src.replace(/^[^\?]+\??/,''); | |
var params = parseQuery( queryString ); | |
function parseQuery ( query ) { | |
var Params = new Object (); | |
if ( ! query ) return Params; | |
// return empty object |
//Uses the haversine formula. | |
-(double) distanceFromCLLocation:(CLLocation*)location { | |
double result; | |
double earthRadius = 3959; //miles | |
double latDelta = (location.coordinate.latitude - self.latitude.doubleValue) * (M_PI/180); | |
double lonDelta = (location.coordinate.longitude - self.longitude.doubleValue) * (M_PI/180); | |
double lat1 = self.latitude.doubleValue * (M_PI/180); |
- (void)mapView:(MKMapView *)mv didAddAnnotationViews:(NSArray *)views { | |
for(MKAnnotationView *annotationView in views) { | |
if(annotationView.annotation == mv.userLocation) { | |
MKCoordinateRegion region; | |
MKCoordinateSpan span; | |
span.latitudeDelta=0.05; | |
span.longitudeDelta=0.05; | |
CLLocationCoordinate2D location=mv.userLocation.coordinate; |
public class ScriptObjectLoader { | |
public static ScriptEngineManager scriptEngineManager; | |
public static ScriptEngine engine; | |
static { | |
scriptEngineManager = new ScriptEngineManager(); | |
engine = scriptEngineManager.getEngineByName("JavaScript"); //Or whatever | |
} | |
@implementation NSManagedObject (NSManagedObject_JSON) | |
/* | |
* | |
* This method is implemented to help NSObject+JSON with transforming to JSON as per SBJSON's JSONValue helper method. | |
* | |
*/ | |
-(NSDictionary*) proxyForJson { | |
NSDictionary * attributes = [[self entity] attributesByName]; | |
NSDictionary * relationships = [[self entity] relationshipsByName]; |
/* | |
* Usage example: | |
* var MongoConnection = require('./mongoconnection').MongoConnection; | |
* mongo_connection = new MongoConnection(process.env.MONGOHQ_URL); | |
* | |
* See also: https://github.com/christkv/node-mongodb-native | |
* | |
* Hat tip to: http://howtonode.org/express-mongodb | |
*/ |