View garmin2nike
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
/* | |
As of 5/13/2013 3:06PM Central Time this script is working. Tweet @runspired to report malfunctions. | |
*/ | |
/* | |
Use the Javascript console in Google Chrome and the tcx2nikeplus converter located here: http://www.awsmithson.com/tcx2nikeplus/ | |
This will take some time to run but will port all of your garmin data to nike+. |
View gist:3565869
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
//just run this in the javascript console and you won't have to see that user's tweets until you leave or refresh the page! | |
function hideTweetsFromScreenName(s) { | |
var tweets = document.querySelectorAll('[data-screen-name='+s+']'); | |
var length = tweets.length; | |
while(length--) | |
tweets[length].parentNode.hidden = true; | |
setTimeout((function(){ hideTweetsFromScreenName(s);}),100); | |
}; |
View timelineManager.js
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 javascript closure will create a timeline manager to let you filter | |
out users and keywords from your stream. In theory it stores the info | |
in a cookie for one day, but cookie setting appears to be not working currently. | |
The manager object has methods for showing a hidden username or keyword, | |
but currently no buttons to do so. | |
Keyword filtration is case sensitive and is done based on a single string | |
match on the tweet's content, it does not match usernames that might |
View complexInterval.js
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 complexInterval = function( fn , t ) { | |
var _delay = t? parseInt(t) : 0 | |
, callback = fn | |
//stores the time of last callback execution for play/pause behavior and firefox shunt | |
, lastExecution = (new Date()).getTime() | |
//shunt for firefox, which executes setTimeout up to 50% early | |
, checkExecution = function(){ var time = (new Date()).getTime() - lastExecution; if (time >= _delay) return true; timeout = setTimeout( (function(){ once(); }), time ); } |
View isIncludedFile.php
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
<?php | |
/* | |
One of the more common PHP questions I've encountered is how to determine whether the currently executing | |
script were included by another script or called directly. Often this question is coupled with AJAX / API | |
security. While none of the three methods below should be used to consider an AJAX or API request valid, | |
they will absolutely tell you whether the script was included. | |
*/ | |
//Method 1 : define a constant in the parent script, check for it in the possibly included script |
View chrome.fixed-relative-scale.js
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
/* | |
Google Chrome fauls to resize the bounding box of elements with relative/absollute position that are within | |
fixed position elements. (Discovered this problem when making this page: http://jthoburn.com/expressive.ly/splash ) | |
This solution is for an 'em based' layout in which width needed to remain in ems in order to not break a scale-while-scroll | |
effect, but would work similarly for pixel and percent based layouts as well. | |
*/ | |
(function(){ | |
var isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1 | |
, forceRender = function(e){ |
View test.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
/* | |
This code is to fix Microsoft TextRange object (IE8 and below), to give equivalent of | |
HTML5 Range object's startContainer,startOffset,endContainer and endOffset properties. | |
*/ | |
/** |
View ember-data-embedded-save.js
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 DSA = {}; | |
DSA.RESTAdapter = DS.RESTAdapter.extend({ | |
/* | |
@private | |
Saves a newly created record, traverses and saves dirty related records | |
Currently Only belongsTo relationships are traversed | |
*/ | |
saveRecord : function(_store,type,record,initiator) { |
View isNumericId.js
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
/* | |
When traversing record.eachRelationship in Ember-Data you | |
may want to actually look up and include the record if it | |
is already in the store. | |
Unfortunately, when dealing with records that are being saved | |
get(record,attribute) may or may not return the record even if | |
it is in the store. | |
If the ID were a temporary ember one (i.e. `<ember-234:null>`) |
View django-crossdomainxhr-middleware.py
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
import re | |
from django.utils.text import compress_string | |
from django.utils.cache import patch_vary_headers | |
from django import http | |
try: | |
import settings | |
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS |
OlderNewer