This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
import datetime | |
import time | |
from firebase_admin import auth | |
import google.auth.exceptions | |
EXP_TIME_GENERIC_TOKEN = int(datetime.timedelta(minutes=15).total_seconds()) | |
RESERVED_CLAIMS = set([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Steps taken from official documentation: | |
# | |
# https://docs.vagrantup.com/v2/virtualbox/boxes.html | |
# | |
# If you get this message while launching a Vagrant box: | |
shell> vagrant up | |
# ... | |
# | |
# Failed to mount folders in Linux guest. This is usually because | |
# the "vboxsf" file system is not available. Please verify that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import sys | |
if len(sys.argv) > 1: | |
code_points = [unicode(c, 'utf-8') for c in sys.argv[1:]] | |
else: | |
# Testing values | |
code_points = [u'\U0001F37A\U00000045\U0000039B', u'\U0001F37A'] | |
#code_points = [unicode('❯❯', 'utf-8')] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
class << self | |
attr_accessor :configuration | |
def config(value=nil) | |
if block_given? | |
yield configuration | |
elsif value | |
configuration[value] | |
else | |
configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import requests | |
import re | |
from urlparse import urlparse, parse_qs | |
GITHUB_URL = 'https://api.github.com' | |
GIST_URL = GITHUB_URL + "/users/{0}/gists" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT='$(machine_name) [%~]$(rvm_prompt_info)$(nvm_prompt_info)$(python_prompt_info) $(git_prompt_info) %{$reset_color%} | |
%{$fg[red]%}λ %{$reset_color%}' | |
machine_name() { | |
#echo "%{$fg[blue]%}%n%{$fg[magenta]%}->%{$fg[blue]%}%m%{$reset_color%}" | |
echo "%{$fg[blue]%}%m%{$reset_color%}" | |
} | |
rvm_prompt_info() { | |
rvm_info=$(rvm-prompt i v g 2> /dev/null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = <username> | |
email = <email> | |
[alias] | |
lg= log --graph --abbrev-commit --date=relative --all | |
co = checkout | |
br = branch | |
ci = commit | |
st = status | |
unstage = reset HEAD -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import cPickle as pickle | |
import json | |
import cjson | |
import ujson | |
d = { | |
'foo': 'bar', | |
'food': 'barf', | |
'good': 'bars', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obj = ParamsValidator::Request.new | |
obj[:data] = "this is a log" | |
obj[:level] = 1 | |
ruleset = MockObject.get_rule(:method2) | |
obj.valid?(ruleset) # false | |
begin | |
obj.validate(ruleset) | |
rescue ArgumentError => ae | |
p ae.message # array with validation errors | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import json | |
def add_underscore(letter): | |
return "_"+letter.group(0).lower() | |
def to_lower(letter): | |
return letter.group(0).lower() | |
def cast_to_underscore_case(value): |
NewerOlder