Data Exchange is going to use Stylus as its CSS preprocessor. Learn good style, and it will be your friend.
This guide includes content adapted from the Obvious Corporation's LESS style guide for Stylus.
""" | |
Credit to sissi_lauty for this algorithm | |
Original: http://stackoverflow.com/a/15077476 | |
""" | |
from math import sqrt | |
def similarity(x, y): | |
# find length of shorter of the two strings | |
n=min(len(x), len(y)) |
<VirtualHost *:80> | |
ServerName myserver.com | |
ServerAlias www.myserver.com | |
ProxyRequests off | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> |
function dontShow(badWord) { | |
$(".thing").each(function(){ | |
var $parent = $(this); | |
var title = $parent.children(".entry").children(".title").children("a").html(); | |
if (title && title.indexOf(badWord) > 0) { | |
console.log(title); | |
$parent.hide(); | |
} | |
}); |
for object in objects | |
object['place'] = object['@place'] |
from tweepy import OAuthHandler | |
from tweepy.streaming import StreamListener | |
from tweepy import Stream | |
from tweepy import API | |
from cleverbot import Cleverbot | |
import json | |
import sys | |
consumer_key = "" |
n = 5 | |
arr = [] | |
# populate array | |
for i in range(0, n): | |
arr.append([]) | |
for j in range(0, n): | |
arr[i].append(j) | |
# print before |
Data Exchange is going to use Stylus as its CSS preprocessor. Learn good style, and it will be your friend.
This guide includes content adapted from the Obvious Corporation's LESS style guide for Stylus.
''' | |
This script moves the largest file from each subdirectory into the | |
same directory that the script is run from. | |
Before: | |
/root | |
/episode1 | |
e1.avi | |
... | |
/episode2 |
import win32api, win32com.client | |
import time, sys | |
# open a shell to type into | |
shell = win32com.client.Dispatch("WScript.Shell") | |
while True: | |
# just some dots to show that it's still running | |
sys.stdout.write('.') | |
sys.stdout.flush() |
import os, sys | |
path = '/path/to/project' | |
settings_module = 'myapp.settings' | |
if path not in sys.path: | |
sys.path.append(path) | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module) |