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 / 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--
<pre style="font: 6px/3px monospace;">+++++++++++++''''''''''''''''''''''''''''''';;;;;;;;;;;;;;;;;;;;'''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:;;;;;;;:::::;;;;;;;:::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;';';;;;;;;;;;;''''''''''''''''''';;;''''';;''''
+++++++++++++''''''''''';;'''''''''''''''''';;;;;;;;;;;;;;;;;;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::;;;;;;::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;';;;;;;;;;;;;'''''''''''''''''';;;;;;;;';;'''
+++++++++++++''''''''''';;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;';''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::;;:;;;:::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;';;;;;;;;;;;;'''''''''''''''''';;;;;;';;;;'''
'++++++++++++''''''''''';;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;'''''''''''''';;;;;;;;;;:;;;;;;;;;;;;;;;;';;;;;;;;;;;;;;;;::::::;;;;:::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;''''''''''+''''''';;;;;''';;''''
''+++'+++++++''''''''''';;;;;;;''''''''''';;;;;;;;;;;;;;;;;;;;;;;';'''''''
@idan
idan / yodawg.txt
Last active August 29, 2015 14:04
+++++++++++++''''''''''''''''''''''''''''''';;;;;;;;;;;;;;;;;;;;'''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:;;;;;;;:::::;;;;;;;:::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;';';;;;;;;;;;;''''''''''''''''''';;;''''';;''''
+++++++++++++''''''''''';;'''''''''''''''''';;;;;;;;;;;;;;;;;;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::;;;;;;::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;';;;;;;;;;;;;'''''''''''''''''';;;;;;;;';;'''
+++++++++++++''''''''''';;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;';''''''''''''';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::::;;:;;;:::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;';;;;;;;;;;;;'''''''''''''''''';;;;;;';;;;'''
'++++++++++++''''''''''';;;;''''''''''''''';;;;;;;;;;;;;;;;;;;;;'''''''''''''';;;;;;;;;;:;;;;;;;;;;;;;;;;';;;;;;;;;;;;;;;;::::::;;;;:::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;''''''''''+''''''';;;;;''';;''''
''+++'+++++++''''''''''';;;;;;;''''''''''';;;;;;;;;;;;;;;;;;;;;;;';''''''''''';;;;;;;;;;;;:;;;;;;;;;;;;;;'''';';
@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 / 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 ____________

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 / gist:9596928
Created March 17, 2014 10:15
Python ISO week for date
import datetime
def week_for_date(target):
"""Given a target date, return a start and end for that date's ISO week.
The returned tuple includes two datetime.date's, (start, end):
start: midnight on the first day of the ISO week containing the target
end: midnight on the first day following the ISO week containing the target
Note that the end date represents the first date _not_ in the target week,
@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.

@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 / _colors.scss
Created January 29, 2014 00:41
Flat UI colors
// Colors from http://designmodo.github.com/Flat-UI/
$color-turquoise: #1abc9c;
$color-green-sea: #16a085;
$color-emerland: #2ecc71;
$color-nephritis: #27ae60;
$color-peter-river: #3498db;
$color-belize-hole: #2980b9;
$color-amethyst: #9b59b6;
$color-wisteria: #8e44ad;
$color-wet-asphalt: #34495e;