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 | |
# | |
# renames a directory of files with their image extension | |
# currently works with only JPEG and PNG files | |
# | |
# 2014.02.25 darell tan | |
# | |
import os | |
import sys |
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
// | |
// flattens object hierarchies like {'US': {'AZ': {size: 999, ...} } } | |
// into array of "rows" like {country: 'US', state: 'AZ': size: 999, ...} | |
// e.g. flatten(data, 2, ['country', 'state']) | |
// | |
// values can also form another level like so: | |
// e.g. flatten(data, 3, ['country', 'state', 'stat']) | |
// which produces: {country: 'US', state: 'AZ', stat: 'size', value: 999} | |
// | |
// NOTE: modifies objects directly, so don't run multiple times with diff levels |
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
cd %1 | |
zip itead-gerbers.zip *.GTL *.GBL *.GTS *.GBS *.GTO *.GBO *.TXT *.GKO *.GMO | |
pause |
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 | |
# | |
# extract permissions and features from Android manifest | |
# put this script into the androguard directory | |
# | |
import os | |
import sys | |
import csv | |
import traceback |
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 | |
# | |
# sequentially re-numbers cells in an IPython notebook | |
# 2014.12.26 darell tan | |
# | |
import json | |
import sys | |
def main(): |
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
// ==UserScript== | |
// @name Yahoo! Finance Portfolio Export | |
// @description Adds a button that lets you export your portfolio | |
// @author Darell Tan | |
// @version 1.2 | |
// @namespace https://gist.github.com/geekman | |
// @match https://finance.yahoo.com/portfolio/pf_*/holdings/edit* | |
// @match https://*.finance.yahoo.com/portfolio/pf_*/holdings/edit* | |
// ==/UserScript== |
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 | |
# | |
# merges screwed up OCR'ed subs, which generated 2 separate items for the same | |
# text, maybe sometimes with italics or not, or different upper/lower case | |
# | |
import sys | |
from pysrt import SubRipFile | |
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 | |
# | |
# modifies zip file attributes | |
# 2015.07.01 darell tan | |
# | |
from zipfile import * | |
import struct | |
import sys |
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
# | |
# lists Foxit Reader last opened files from registry | |
# 2015.08.31 darell tan | |
# | |
from _winreg import * | |
from ctypes import windll, create_unicode_buffer | |
def GetLongPathName(path): |
OlderNewer