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
# This is file ~/.gitconfig | |
[merge] | |
tool = extMerge | |
[mergetool "extMerge"] | |
cmd = ~/bin/extMerge.sh \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\" |
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
- (CLLocationDistance)getDistanceFrom:(CLLocationCoordinate2D)start to:(CLLocationCoordinate2D)end | |
{ | |
CLLocation *startLoc = [[CLLocation alloc] initWithLatitude:start.latitude longitude:start.longitude]; | |
CLLocation *endLoc = [[CLLocation alloc] initWithLatitude:end.latitude longitude:end.longitude]; | |
CLLocationDistance retVal = [startLoc distanceFromLocation:endLoc]; | |
[startLoc release]; | |
[endLoc release]; | |
return retVal; | |
} |
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
#routes.rb | |
get 'scraped_episodes_search' => 'scraped_episodes#search' | |
#scraped_episodes_controller.rb | |
# used for autocomplete search | |
def search |
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
// https://gist.github.com/Yaffle/1287361 | |
var crc32table = null; | |
crc32 = function(s) { | |
s = String(s); | |
var polynomial = 0x04C11DB7, | |
initialValue = 0xFFFFFFFF, | |
finalXORValue = 0xFFFFFFFF, | |
crc = initialValue, | |
i, j, c; |
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
module CustomColumnTypes | |
def double(*args) | |
if !args.last.is_a? Hash | |
args.push({}) | |
end | |
args.last[:limit] = 53 | |
float *args | |
end |
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
// only supports messages up to 65536 characters long | |
// takes a first param of byte_count and generates the correct "websocket style" header | |
// *header_len is set to the number of bytes used in header[] | |
void build_message_header(const size_t byte_count, char header[3], size_t* header_len) | |
{ | |
size_t len = byte_count; | |
if( len < 126 ) | |
{ | |
header[0] = len & 0xff; | |
*header_len = 1; |
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
/************************************************************************************************** | |
* Filename: hal_defs.h | |
* Description: This file contains useful macros and data types | |
* | |
* | |
* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ | |
* | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions |
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 isArray(x) { | |
return _.isArray(x) && !EJSON.isBinary(x); | |
} | |
// pulled from "LocalCollection._makeLookupFunction" | |
var dotNotationFetch = function (key) { | |
var dotLocation = key.indexOf('.'); | |
var first, lookupRest, nextIsNumeric; | |
if (dotLocation === -1) { | |
first = key; |
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
// put me at server/email.js | |
Meteor.startup(function () { | |
var user = "user"; | |
var password = "password"; | |
var serverAndPort = "smtp.example.com:9999"; | |
var string = 'smtp://' + user + ':' + password + '@' + serverAndPort; | |
process.env.MAIL_URL = string; | |
}); |
OlderNewer