This file contains hidden or 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/sh | |
USER=god | |
PASS=allyourbasearebelongtous | |
FILE=`echo "$1" | sed 's_\(https://\)\(.*\)\(secure\.\)\(.*\)\(/.*\)_\2\4\5_'` | |
FILE=`echo "$1" | sed 's_\(https://\)\(boost4-\)*\(.*\)\(secure\.\)\(.*\)\(/.*\)_\3\5\6_'` | |
CMD='curl -Y 12800 -y 5 -C - -O http://'$USER':'$PASS'@'$FILE | |
echo $CMD |
This file contains hidden or 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 os | |
import re | |
import hashlib | |
def tagAll(dirname): | |
files = os.listdir(dirname) | |
files = [x for x in files if not os.path.isdir(dirname + '/' + x)] | |
tagged = {} | |
dupes = [] | |
originals = [] |
This file contains hidden or 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
* Script to record and tag spotify tracks, by Lloyd Moore *) | |
(* Make sure you are already recording in Audio Hijack Pro with a session called 'spotifySession' *) | |
tell application "Spotify" | |
set currentTrack to (current track) | |
set trackName to (name of currentTrack) | |
tell application "Audio Hijack Pro" | |
set theSession to my getSession() | |
end tell | |
repeat |
This file contains hidden or 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 Pivot { | |
protected $pivotedData; | |
public function __construct($data){ | |
$this->pivotedData = $this->_pivot($data); | |
} | |
protected function pivot($data){ | |
$pivoted = []; |
This file contains hidden or 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
git show HEAD|grep diff|awk '{print $3;}' |
This file contains hidden or 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
""" | |
To use just type ... python letterPressSolver.py <25 letter string of grid> <favourite letters> | |
""" | |
class Solver(): | |
def __init__(self, grid): | |
wordList = open('/usr/share/dict/words').readlines() | |
self.wordList = [x.lower().strip() for x in wordList] | |
self.grid = list(grid) | |
self.grid.sort() |
This file contains hidden or 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
open Printf | |
type 'a io = { i: 'a; o: 'a } |
This file contains hidden or 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
def numerals: List[char]): int = in match { | |
case 'i' :: 'v' :: xs => 4 + numerals(xs) | |
case 'i' :: 'X' :: xs => 9 + numerals(xs) | |
case 'i' :: xs => 1 + numerals(xs) | |
case 'v' :: xs => 5 + numerals(xs) | |
case 'X' :: 'L' :: xs => 40 + numerals(xs) | |
case 'X' :: 'c' :: xs => 90 + numerals(xs) | |
case 'X' :: xs => 10 + numerals(xs) | |
case 'L' :: xs => 50 + numerals(xs) | |
case 'c' :: 'd' :: xs => 400 + numerals(xs) |
This file contains hidden or 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
def set_end_point(view_class, endpoint, url, pk='id', pk_type='int'): | |
view = view_class() | |
app.add_url_rule(url, defaults={id: None}, view_func=view.as_view, methods=['GET',]) | |
app.add_url_rule(url, view_func=view.as_view, methods=['POST',]) | |
url = '%s/<%s:%s>' % (url, pk_type, pk) | |
app.add_url_rule(url, view_func=view.as_view, methods=['GET', 'PUT', 'DELETE']) | |
def register_url(name): |
This file contains hidden or 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
def to_json(self, view='list_view'): | |
out = {} | |
for f in self.get_fields(view): | |
field_value = getattr(self, f) | |
if hasattr(f, 'to_json'): | |
out[f] = field_value.to_json(view) # relation object | |
elif hasattr(f, 'isoformat'): | |
out[f] = field_value.isoformat() # datetime object |
OlderNewer