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
/* YOSPOS Style | |
Concept by Sweevo | |
CSS by Anal Volcano | |
Link flashing animation by roboshit | |
I totally forgot who did the images :( | |
*/ | |
body { |
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 Max Size | |
// www.labs.skengdon.com/maxSize | |
;(function($){$.fn.maxSize=function(options){if(typeof options!=='object'){var options={width:options,height:options}};return this.each(function(){$img=$(this);var F;var FW=0;var FH=0;if(options.width){FW=$img.width()/options.width;F=1;};if(options.height){FH=$img.height()/options.height;F=0;};if(FW&&FH){F=FW/FH;};if((F>=1)&&(FW>=1)){$(this).width(options.width);};if((F<=1)&&(FH>=1)){$(this).height(options.height);};});};})(jQuery); | |
// fixed TIMG script for Something Awful forums | |
// depends on JQuery, so make sure it's loaded after jquery-min.js. Should work fine with the version on SA (1.4.2) | |
$("img.timg").one('load', function() { | |
var img = this; |
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
for (var i=0; i < 10; i++) { | |
reqManager.createReq({ | |
url: "https://api.github.com/repos/jquery/jquery/pulls/" + i + "?callback=?", | |
type: "get", | |
dataType: "jsonp", | |
// callback for when this request has completed | |
onSuccess: savePullRequest | |
}); | |
} |
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
from datetime import datetime | |
from django.utils.translation import ugettext_lazy as _ | |
from django.db import models | |
from django.contrib.auth.models import User | |
from django.template.defaultfilters import slugify | |
from django.template.loader import render_to_string | |
from django.conf import settings | |
from model_utils import Choices |
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
Django==1.3.1 | |
Pinax | |
django-debug-toolbar==0.8.4 | |
django-staticfiles==1.1.2 | |
django_compressor==1.0.1 | |
# [more Pinax-generated stuff] | |
-e git+http://github.com/pinax/pinax-theme-bootstrap.git#egg=pinax-theme-bootstrap |
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 sys | |
def find_factors(n): | |
factors = [1, n] | |
for i in range(2, int(n ** 0.5) + 1): | |
if n % i == 0: | |
factors.append(i) | |
factors.append(n / i) | |
if factors[-1] == factors[-2]: |
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
#!/usr/bin/python | |
import urllib2 | |
import json | |
import shutil | |
import os | |
import argparse | |
import subprocess | |
parser = argparse.ArgumentParser(description="Download, rename, and move maps from Mania-Exchange.") |
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 ordered_to_dict(ordered_dict): | |
reg_dict = dict(ordered_dict) | |
for key, value in reg_dict.iteritems(): | |
if isinstance(value, OrderedDict): | |
reg_dict[key] = ordered_to_dict(value) | |
return reg_dict |
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 redis | |
r = redis.StrictRedis(host='localhost', port=6379, db=0) | |
# [... flask routing code, sql queries, etc. ...] | |
r.publish("sms_replies", "%s %s %s" % (user.nick, user.last_sms_sender, text)) |
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
<html> | |
<head> | |
<title>Squiggle Demo</title> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js "></script> | |
<script src="squiggle.js"></script> | |
<style> | |
path { |
OlderNewer