- click goals
measures how often visitors click an element
url targeting
// ---- | |
// Sass (v3.4.9) | |
// Compass (v1.0.1) | |
// ---- | |
//Write mixins where the pattern takes variables | |
@mixin transparent-backgroung($color, $alpha) { | |
$rgba: rgba($color, $alpha); | |
$ie-hex-str: ie-hex-str($rgba); | |
background-color: transparent; |
// ---- | |
// Sass (v3.4.9) | |
// Compass (v1.0.1) | |
// ---- | |
//Use placeholders for repeating visual styles | |
%dotted-border { border: 1px dotted #eee; } | |
.box1 { | |
@extend %dotted-border; |
# Last, Middle, First | |
(\w+)(,\ )(\w+.),\ (\w+) | |
# First Middle. Last, Title | |
(\w+)\ (\w+).\ (\w+),\ (\w+) | |
# First Last (via Twitter) | |
(\w+)\ (\w+)\ (\([\w\ ]+\)) |
$.fn.scrollFoo = function() { | |
'use strict' | |
var that = this, | |
didscroll = false; | |
$(window).scroll(function() { | |
didscroll = true; | |
}); |
def is_equal(val1, val2): | |
""" | |
This is a really nice way to comparing two hash values using the set operation XOR | |
This snippet is from the plone project https://github.com/plone/plone.session/blob/master/plone/session/tktauth.py | |
""" | |
# constant time comparison | |
if not isinstance(val1, basestring) or not isinstance(val2, basestring): | |
return False |
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.0) | |
// ---- | |
@mixin animation($animate...) { | |
$max: length($animate); | |
$animations: ''; | |
@for $i from 1 through $max { |
import sys | |
num = 0 | |
def printNum(func): | |
def pprint(*args, **kwargs): | |
global num | |
num += 1 | |
sys.stdout.write(u'%s: ' % num) | |
sys.stdout.write(func(*args, **kwargs)) | |
sys.stdout.write(u'\n') | |
return pprint |
import csv | |
import codecs | |
fin = 'quick-statistics.csv' | |
threshold = 40 | |
lines_to_keep = [] | |
with open(fin, 'r') as f: | |
keep_line = 0 | |
reader = csv.reader(f) |
# This code is via http://www.turnkeylinux.org/blog/python-symmetric-encryption | |
# Author: Alon Swartz | |
import zlib | |
import struct | |
from Crypto.Cipher import AES | |
class CheckSumError(Exception): | |
pass |