Skip to content

Instantly share code, notes, and snippets.

@kristi
kristi / .zshrc
Created February 13, 2011 03:01
.zshrc file (from cygwin)
# The following lines were added by compinstall
zstyle :compinstall filename '/home/kristi/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory
unsetopt beep
@kristi
kristi / Counter.py
Created February 20, 2011 05:36
Python Counter class
from operator import itemgetter
from heapq import nlargest
from itertools import repeat, ifilter
# Python 3.1 has a builtin Counter class.
# This class mimics that functionality for Python 2.x
#
# Original code by Raymond Hettinger ()
# Source http://code.activestate.com/recipes/576611/
# Revision 11
@kristi
kristi / style.css
Created February 23, 2011 20:55
OSQA theme style
/*
* OSQA theme style.css
* Modified the default OSQA style, removing a lot of backgrounds and drop shadows.
*
* Replace the file at osqa-server/forum/skins/default/media/style/style.css
*
* Original source from OSQA v0.9 beta2
* Last modified: Feb 23, 2011
*/
@kristi
kristi / latex.tex
Created March 13, 2011 18:49
latex math template
\documentclass{article}
\usepackage[margin=1.25in]{geometry}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{amsmath}
\usepackage{amsfonts} % math fonts
\usepackage{amssymb} % extra math symbols
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{verbatim} % \begin{comment} multi-line comments \end{comment}
@kristi
kristi / template.tex
Created June 13, 2011 17:48
Latex template
% Redefine maketitle for more condensed title
\documentclass{article}
\usepackage{titlesec}
\usepackage{amsmath}
\usepackage{amsfonts} % fonts
\usepackage{amssymb} % extra symbols
%\usepackage{amsthm} % replace with ntheorem
\usepackage{graphicx}
\usepackage[margin=1.1in, top=.75in]{geometry}
\usepackage{mathtools}
@kristi
kristi / wp-syntax_colorizer.php
Created July 25, 2011 07:40
WP-Syntax Colorizer - Custom Geshi Colors
<?php
/*
Plugin Name: WP-Syntax Colorizer
Plugin URI: http://articles.akgfx.com/2008/04/wp-syntax-colorizer/
Description: A plugin allowing you to easily set all the WP-Syntax color settings in one place. WP-Syntax was developed by Ryan McGeary.
Author: Arash Keshmirian
Version: 0.1
Author URI: http://www.akgfx.com/
*/
@kristi
kristi / Z example commit message
Created August 14, 2011 21:27
customize git commit message
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: src/taikonome/Taikonome.as
# modified: taikonome.as3proj
#
@kristi
kristi / bookmarklet
Created August 29, 2011 05:59
Bookmarklet: See all Facebook group posts
javascript:(function(){var%20t=0;function%20moar(){var%20e=document.querySelectorAll(%22a.pam%22);if(e.length%3E0){e[0].onclick();var%20e=document.querySelectorAll(%22input.stat_elem%22);for(var%20i=0;i%3Ce.length;i=i+1){e[i].click();}}else{t=setInterval(expand,3000);}}function%20expand(){var%20e=document.querySelectorAll(%22input.stat_elem%22);for(var%20i=0;i%3Ce.length;i=i+1){e[i].click();}if(e.length==0){clearInterval(t);}}t=setInterval(moar,1500);})();
@kristi
kristi / get_fb_app_token
Created September 1, 2011 16:00
get facebook app access token
#!/usr/bin/env python
import urllib2
app_id='123abc'
app_secret='987fed'
def get_app_access_token(app_id, app_secret):
app_login_url = 'https://graph.facebook.com/oauth/access_token?client_id={app_id}&client_secret={app_secret}&grant_type=client_credentials'.format(app_id=app_id, app_secret=app_secret)
@kristi
kristi / missing.py
Created September 1, 2011 16:07
find missing natcomm facebook members
#!/usr/bin/env python
import codecs
import json
import urllib2
tcomm_id = '105089836262253'
natcomm_id = '134083046643371'
# Get token from
# https://developers.facebook.com/tools/explorer
# or create a fb app (https://developers.facebook.com/apps)