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
#!/bin/bash | |
# git-find-large-files | |
# Shows you the largest objects in your repo's pack file. | |
# Written for osx. | |
# | |
# @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
# @see https://stackoverflow.com/questions/10622179/how-to-find-identify-large-commits-in-git-history/10622293#10622293 | |
# @author Antony Stubbs |
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
#!/bin/bash | |
jq_str='(.title + ": " + .choicea + " OR " + .choiceb + " - " + .link + " (" + (.votes|tostring) + " votes)")' | |
curl -Ss "https://www.rrrather.com/botapi" | jq -r "$jq_str" |
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
$ osascript -e "if application \"Spotify\" is running then tell application \"Spotify\" to get artist of current track & \" - \" & name of current track" | |
Tirzah - Fine Again |
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 argparse | |
import cPickle | |
import json | |
import math | |
import os.path | |
import matplotlib.pyplot as plt | |
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 random | |
import threading | |
import time | |
class MyObject(object): | |
thread_id = None | |
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
#!/bin/bash | |
### | |
# Check the current version of a lib on pypi | |
# | |
# https://gist.github.com/loisaidasam/2cb9bcc32312ca673c933ef07cdc706f | |
# | |
# Requires `curl` and [pup](https://github.com/ericchiang/pup) | |
### |
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
SERVICE_ID_TACO_BELL = 1 | |
SERVICE_ID_T_MOBILE = 2 | |
SERVICE_NAMES = { | |
SERVICE_ID_TACO_BELL: "Taco Bell", | |
SERVICE_ID_T_MOBILE: "T-Mobile", | |
} | |
class BaseService(object): |
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
# Base class | |
In [1]: class Foo(object): | |
...: @property | |
...: def bar(self): | |
...: raise NotImplementedError | |
...: | |
# Subclass 1, with property explicitly set | |
In [2]: class Foof(Foo): | |
...: bar = "taco" |
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
master=> SELECT * FROM (VALUES (1, true), (2, false), (3, null)) AS t (id,value); | |
id | value | |
----+------- | |
1 | t | |
2 | f | |
3 | | |
(3 rows) | |
master=> SELECT * FROM (VALUES (1, true), (2, false), (3, null)) AS t (id,value) order by value; | |
id | value |
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
#!/bin/bash | |
# Via https://github.com/iamcal/emoji-data | |
# Requires jq | |
# https://stedolan.github.io/jq/ | |
curl -Ss "https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json" | jq '[.[] | .short_name]' |