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
# Using Jupyter 4.2 and Python 3.5.1 | |
# Firstly, Jupyter notebook stuff | |
# | |
# Make the notebook the width of the brower window | |
from IPython.core.display import HTML | |
HTML("<style>.container { width:100% !important; }</style>") | |
#----- | |
# Now pandas stuffs |
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
__author__ = 'danlmarmot' | |
""" | |
This Python script measures hash performance, and attempts to answer this question: | |
'Given a hash function and a block size for reading, which is the fastest hash function and block size?' | |
There's no warm up, there's no cache/memory/whatever filling, just a simple way to explore performance for | |
commonly used functions with the timeit library | |
""" |
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
#!/usr/bin/python | |
import os | |
import sys | |
import logging | |
import time | |
import json | |
from time import mktime | |
from boto.s3.connection import S3Connection | |
from boto.exception import S3DataError, S3ResponseError |
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 | |
# | |
# cm-crontab-list | |
# | |
# Taken from yukondude's answer at | |
# http://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users | |
# System-wide crontab file and cron job directory. Change these for your system. | |
CRONTAB='/etc/crontab' | |
CRONDIR='/etc/cron.d' |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/python | |
from pymongo import Connection | |
from collections import defaultdict | |
import os, sys, time | |
import pprint | |
import requests | |
import urllib | |
import re | |
try: import simplejson as json |
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
javascript:(function(){m='http://mail.google.com/mail/?view=cm&fs=1&tf=1&to=&su='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(document.location);w=window.open(m,'addwindow','status=no,toolbar=no,width=575,height=545,resizable=yes');setTimeout(function(){w.focus();}, 250);})(); |
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
#!/usr/bin/env python | |
''' | |
Small demo of how to get a standalone Python script working in Spark 1.1 through the regular Python interpreter, | |
rather than using bin/pyspark <filename.py>. | |
Useful for interactive debugging and avoids messing with PYTHONPATH, I used this script to verify my PyCharm IDE | |
was correctly configured. | |
Note that Spark is installed at ~/bin/spark/current |
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
__author__ = 'danlmarmot' | |
from itertools import permutations | |
import collections | |
INPUT_WORD = "deposit" | |
MIN_ANAGRAM_LEN = 4 | |
WORD_DICT_FILEPATH = '/usr/share/dict/words' | |
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 | |
# | |
patternMatches="foo/target/*.jar | |
bar/target/*.jar | |
baz/target/*.jar | |
" | |
bucket=my-bucketname | |
objectPath=bucketdir/subdir |