Skip to content

Instantly share code, notes, and snippets.

View ykessler's full-sized avatar

Yarin Kessler ykessler

  • appgrinders
  • New York City
View GitHub Profile
javascript: window.location = `http://webcache.googleusercontent.com/search?q=cache:${window.location}`;
@ykessler
ykessler / jquery-shortcuts.js
Created October 23, 2022 15:37
Two jQuery shortcuts you know you want
(function($){
$.fn.id = function() {
return $(this).attr('id');
};
$.fn.name = function() {
return $(this).attr('name');
};
})(jQuery);
@ykessler
ykessler / gae_handler.py
Created May 11, 2012 20:23
Python logging handlers
class GAEHandler(logging.Handler):
"""
Logging handler for GAE DataStore
"""
def emit(self, record):
from google.appengine.ext import db
class Log(db.Model):
name = db.StringProperty()
@ykessler
ykessler / timezones
Created August 14, 2012 14:50
JSON list of time zones (Based on Olson tz database)
[
{"group":"US (Common)",
"zones":[
{"value":"America/Puerto_Rico","name":"Puerto Rico (Atlantic)"},
{"value":"America/New_York","name":"New York (Eastern)"},
{"value":"America/Chicago","name":"Chicago (Central)"},
{"value":"America/Denver","name":"Denver (Mountain)"},
{"value":"America/Phoenix","name":"Phoenix (MST)"},
{"value":"America/Los_Angeles","name":"Los Angeles (Pacific)"},
{"value":"America/Anchorage","name":"Anchorage (Alaska)"},
@ykessler
ykessler / timezones
Created August 14, 2012 14:49
HTML list of time zones (Based on Olson tz database)
<select name="timezone" >
<option disabled selected style='display:none;'>Time Zone...</option>
<optgroup label="US (Common)">
<option value="America/Puerto_Rico">Puerto Rico (Atlantic)</option>
<option value="America/New_York">New York (Eastern)</option>
<option value="America/Chicago">Chicago (Central)</option>
<option value="America/Denver">Denver (Mountain)</option>
<option value="America/Phoenix">Phoenix (MST)</option>
<option value="America/Los_Angeles">Los Angeles (Pacific)</option>