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 yql | |
>>> y = yql.Public() | |
>>> appid = 't4RpMGDV34GSa2qGuiJ1aC_WG8xmsw6lM5psHclL0Yawu2.wZm1ejtuGSLndPWdx5oyDrDQ-' | |
>>> query = 'select * from search.spelling where query="%s" and appid="%s"' % ('janet nopalitano', appid) | |
>>> r = y.execute(query) | |
>>> r.raw | |
{u'count': 0, u'lang': u'en-US', u'results': None, u'created': u'2011-09-01T20:38:10Z'} |
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
class UserProfileForm(forms.ModelForm): | |
phone = USPhoneNumberField(required=False) | |
email = forms.EmailField(required=False) | |
class Meta: | |
model = UserProfile | |
fields = ('phone', 'email') | |
def __init__(self, *args, **kwargs): | |
if kwargs.get('instance'): |
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 loveit = function(){ | |
var e,el,interval=Math.random()*60000; | |
e = new jQuery.Event("click"); | |
e.pageX=1; | |
e.pageY=1; | |
el = jQuery('.record_pile:last').nextAll('a').eq(2); | |
turntable.lastMotionTime=new Date().getTime(); | |
el.hover().trigger(e); | |
setTimeout(loveit, interval); | |
}; |
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
apt-get install zlib1g-dev | |
apt-get install g++ | |
export VENV=$VIRTUAL_ENV | |
mkdir $VENV/packages && cd $VENV/packages | |
wget http://oligarchy.co.uk/xapian/1.0.16/xapian-core-1.0.16.tar.gz | |
wget http://oligarchy.co.uk/xapian/1.0.16/xapian-bindings-1.0.16.tar.gz | |
tar xzvf xapian-core-1.0.16.tar.gz |
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
if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){ | |
var div = document.createElement("div"); | |
div.innerHTML = "<div class='test e'></div><div class='test'></div>"; | |
// Opera can't find a second classname (in 9.6) | |
if ( div.getElementsByClassName("e").length === 0 ) | |
return; | |
// Safari caches class attributes, doesn't catch changes (in 3.2) | |
div.lastChild.className = "e"; |
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
/* jQuery Cycle 2.88 */ | |
(function(d){function h(a){d.fn.cycle.debug&&o(a)}function o(){window.console&&window.console.log&&window.console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function e(a,b,f){function k(n,m,q){if(!n&&m===true){n=d(q).data("cycle.opts");if(!n){o("options not found, can not resume");return false}if(q.cycleTimeout){clearTimeout(q.cycleTimeout);q.cycleTimeout=0}w(n.elements,n,1,!j.rev&&!j.backwards)}}if(a.cycleStop==undefined)a.cycleStop=0;if(b===undefined||b===null)b={};if(b.constructor== | |
String){switch(b){case "destroy":case "stop":var j=d(a).data("cycle.opts");if(!j)return false;a.cycleStop++;a.cycleTimeout&&clearTimeout(a.cycleTimeout);a.cycleTimeout=0;d(a).removeData("cycle.opts");b=="destroy"&&i(j);return false;case "toggle":a.cyclePause=a.cyclePause===1?0:1;k(a.cyclePause,f,a);return false;case "pause":a.cyclePause=1;return false;case "resume":a.cyclePause=0;k(false,f,a);return false;case "prev":case "next":j=d(a).data("cycle.opts");if(!j){o('options not found, "prev/n |
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
def _authenticate_oauth_echo | |
require 'httparty' | |
# header auth only for now; also lock down the auth provider endpoint so we can't spoof | |
if(request.env["HTTP_X_AUTH_SERVICE_PROVIDER"] != 'https://api.twitter.com/1/account/verify_credentials.json') | |
return false | |
else | |
auth_service_provider = request.env["HTTP_X_AUTH_SERVICE_PROVIDER"] | |
verify_credentials_authorization = request.env["HTTP_X_VERIFY_CREDENTIALS_AUTHORIZATION"] | |
end | |
NewerOlder