Skip to content

Instantly share code, notes, and snippets.

View mgile's full-sized avatar

Michael Gile mgile

View GitHub Profile
@mgile
mgile / fake_https
Created April 18, 2011 22:13
A stunnel configuration file for use with Django runserver
pid=
cert = /usr/local/etc/stunnel/stunnel.pem
sslVersion = SSLv3
foreground=yes
debug = 7
output = /path/to/stunnel.log
[https]
accept=8443
@mgile
mgile / OBD2Kit_Sample.m
Created April 18, 2011 23:51
OBD2Kit Basic Scan Tool Setup
_scanTool = [FLScanTool scanToolForDeviceType:kScanToolDeviceTypeELM327];
[_scanTool retain];
_scanTool.useLocation = YES;
_scanTool.delegate = self;
if(_scanTool.isWifiScanTool ) {
// These are the settings for the PLX Kiwi WiFI, your Scan Tool may
// require different.
[_scanTool setHost:@"192.168.0.10"];
@mgile
mgile / OBD2Kit_ResponseDelegate.m
Created April 18, 2011 23:53
OBD2Kit Handling the delegate for responses
- (void)scanTool:(FLScanTool*)scanTool didReceiveResponse:(NSArray*)responses {
[responses retain];
FLECUSensor* sensor = nil;
for (FLScanToolResponse* response in responses) {
sensor = [FLECUSensor sensorForPID:response.pid];
[sensor setCurrentResponse:response];
if (response.pid == 0x0C) {
@mgile
mgile / gist:1051370
Created June 28, 2011 15:20
CALLBACK Javascript function to maintain scope
function CALLBACK(objScope, funcName) {
return function() {
objScope[funcName].apply(objScope, arguments);
};
};
@mgile
mgile / gist:1051375
Created June 28, 2011 15:21
callbacks from within a Javascript "class"
var MyClass = function() {
this.myObject = {};
this.name = "MyClass";
};
/**
* doSomethingWithFileData
* @param err
* @param fileData
*/
@mgile
mgile / 2-games-by-user-large-horizontal.html
Created December 29, 2011 17:15
NHL - Wayin iframe widget integration
<div id="nhl-game-widget-container"></div>
<script id="wayin-widget" src="http://www.wayin.com/widgets/scripts/nhl-widgets.js"></script>
<script>
Wayinwidget.gamesByUser('nhl-game-widget-container', "NHL", null);
</script>
@mgile
mgile / nhl-custom-example.html
Created January 4, 2012 23:05
NHL All-Star Game - Wayin iframe widget integration
<div id="nhl-game-widget-container"></div>
<script id="wayin-widget" src="/widgets/scripts/nhl-custom-widgets.js"></script>
<script>
Wayinwidget.gamesByUser('nhl-game-widget-container', "NHL", null);
</script>
@mgile
mgile / adv-horizontal-widget.html
Created January 10, 2012 23:16
Advanced Horizontal Widget Installation
<div id="advanced-horizontal-widget-container"></div>
<script id="wayin-widget" src="http://www.wayin.com/widgets/scripts/widgets.js"></script>
<script>
Wayinwidget.gamesByUser('advanced-horizontal-widget-container', "<your username>", {
liststyle: 'advancedHorizontal',
bgcolor: '#ffffff',
gamestatus: 'ANY'
});
@mgile
mgile / adv-vertical-widget.html
Created January 10, 2012 23:17
Advanced Vertical Widget Installation
<div id="advanced-vertical-widget-container"></div>
<script id="wayin-widget" src="http://www.wayin.com/widgets/scripts/widgets.js"></script>
<script>
Wayinwidget.gamesByUser('advanced-vertical-widget-container', "<your username>", {
liststyle: 'advancedVertical',
bgcolor: '#ffffff',
gamestatus: 'ANY'
});
@mgile
mgile / wayin-mobile-widget.html
Created March 1, 2012 22:31
Wayin Mobile Widget Example
<div id="mobile-widget-container"></div>
<script id="wayin-widget" src="http://www.wayin.com/widgets/scripts/widgets.js"></script>
<script>
Wayinwidget.gamesByUser('mobile-widget-container', "<your username>", {
imgsize: 'medium',
liststyle: 'mobile',
listsize: 1,
bgcolor: '#eee',