Skip to content

Instantly share code, notes, and snippets.

View idan's full-sized avatar
💫
Prototypin'

Idan Gazit idan

💫
Prototypin'
View GitHub Profile
@idan
idan / foo.py
Created February 17, 2014 20:25
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
""" Get the environment variable or return an exception """
try:
return os.environ[var_name]
except KeyError:
error_msg = "Set the {} environment variable".format(var_name)
raise ImproperlyConfigured(error_msg)
@idan
idan / README.md
Last active August 29, 2015 13:56
Standardizing Pagerduty Timezones

Standardizing Pagerduty Timezones

Do you consume the Pagerduty API? Are you annoyed that the timezones they use aren't standard IANA timezone names used by pretty much every timezone library that builds on the Olson TZ database?

Yeah, me too.

I dug around and found a mapping, however it had a few inconsistencies. I've gone down the list and verified each one. Here's a JSON for you. Enjoy!

Diff of the zones I altered is below as well.

Keybase proof

I hereby claim:

  • I am idan on github.
  • I am idan (https://keybase.io/idan) on keybase.
  • I have a public key whose fingerprint is 70F9 25D5 16F0 BB41 2528 4A9C 1D75 D464 EF68 5D48

To claim this, I am signing this object:

@idan
idan / foo.md
Created May 6, 2014 21:17
Test public gist!

I once knew a lady named Daria who was visiting friends in Ontario "It's so cold here!" she said As she snuggled in bed and related the news via ____________

@idan
idan / diagnostics.scss
Created July 13, 2014 20:21
d3 styling
.d3Content {
fill: none;
.area {
fill: #eee;
stroke: none;
&.light { fill: transparentize($light, 0.7); }
&.dark { fill: transparentize($dark, 0.7); }
&.crit { fill: transparentize($crit, 0.5); }
}
@idan
idan / yodawg.txt
Last active August 29, 2015 14:04
+++++++++++++''''''''''''''''''''''''''''''';;;;;;;;;;;;;;;;;;;;'''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:;;;;;;;:::::;;;;;;;:::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;';';;;;;;;;;;;''''''''''''''''''';;;''''';;''''
+++++++++++++''''''''''';;'''''''''''''''''';;;;;;;;;;;;;;;;;;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::;;;;;;::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;';;;;;;;;;;;;'''''''''''''''''';;;;;;;;';;'''
+++++++++++++''''''''''';;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;';''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::;;:;;;:::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;';;;;;;;;;;;;'''''''''''''''''';;;;;;';;;;'''
'++++++++++++''''''''''';;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;'''''''''''''';;;;;;;;;;:;;;;;;;;;;;;;;;;';;;;;;;;;;;;;;;;::::::;;;;:::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;''''''''''+''''''';;;;;''';;''''
''+++'+++++++''''''''''';;;;;;;''''''''''';;;;;;;;;;;;;;;;;;;;;;;';''''''''''';;;;;;;;;;;;:;;;;;;;;;;;;;;'''';';
<pre style="font: 6px/3px monospace;">+++++++++++++''''''''''''''''''''''''''''''';;;;;;;;;;;;;;;;;;;;'''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:;;;;;;;:::::;;;;;;;:::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;';';;;;;;;;;;;''''''''''''''''''';;;''''';;''''
+++++++++++++''''''''''';;'''''''''''''''''';;;;;;;;;;;;;;;;;;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::;;;;;;::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;';;;;;;;;;;;;'''''''''''''''''';;;;;;;;';;'''
+++++++++++++''''''''''';;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;';''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::;;:;;;:::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;';;;;;;;;;;;;'''''''''''''''''';;;;;;';;;;'''
'++++++++++++''''''''''';;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;'''''''''''''';;;;;;;;;;:;;;;;;;;;;;;;;;;';;;;;;;;;;;;;;;;::::::;;;;:::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;''''''''''+''''''';;;;;''';;''''
''+++'+++++++''''''''''';;;;;;;''''''''''';;;;;;;;;;;;;;;;;;;;;;;';'''''''
@idan
idan / private.xml
Created September 4, 2014 09:03
Idan's Karabiner private.xml
<?xml version="1.0"?>
<root>
<item>
<name>Remap Caps Lock to Hyper</name>
<appendix>OS X doesn't have a Hyper. This maps Left Control to Control + Shift + Option + Command.</appendix>
<identifier>caps_lock_to_hyper</identifier>
<autogen>
--KeyToKey--
@idan
idan / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@idan
idan / javascript_resources.md
Last active August 29, 2015 14:08 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage