Skip to content

Instantly share code, notes, and snippets.

View kimsterv's full-sized avatar

Kim Lewandowski kimsterv

View GitHub Profile
@kimsterv
kimsterv / gist:1251689
Created September 29, 2011 19:30
First Post
*******************************************************
A pirate walks into a bar. The bartender notices that the pirate
has a steering wheel in his pants, and promptly inquires, "Sir,
I can't help but ask, why do you have a steering wheel in your
pants?"
With this the pirate replies, "Yaaar! Its driving me nuts!"
*******************************************************
@kimsterv
kimsterv / gist:1297195
Created October 19, 2011 00:42
django comment signals
from django.contrib.comments.signals import comment_was_posted
@receiver(comment_was_posted)
def my_callback(sender, **kwargs):
comment = kwargs.get('comment')
request = kwargs.get('request')
@kimsterv
kimsterv / tz.js
Created August 9, 2012 18:11
looking for user's timezone
var cookie_tz = $.cookie('tz');
if (user_tz == null) {
if (cookie_tz == null) {
try {
var tmp_tz = jstz.determine_timezone();
if (tmp_tz) {
user_tz = tmp_tz.name();
$.cookie('tz', user_tz);
}
} catch(err) {
@kimsterv
kimsterv / timezone.js
Created August 9, 2012 18:11
timezone detection
/*
* Original script by Josh Fraser (http://www.onlineaspect.com)
* Continued and maintained by Jon Nylander at https://bitbucket.org/pellepim/jstimezonedetect
*
* Provided under the Do Whatever You Want With This Code License.
*/
/**
* Namespace to hold all the code for timezone detection.
*/