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
# This code is public domain, share and enjoy. | |
from Foundation import NSPropertyListSerialization | |
from xattr import setxattr, getxattr | |
kMDItemWhereFroms = "com.apple.metadata:kMDItemWhereFroms" | |
def set(path, *data): | |
"""Set kMDItemWhereFroms on a file. Pass in an array of strings.""" | |
plist, err = NSPropertyListSerialization.dataWithPropertyList_format_options_error_(data, 200, 0, None) | |
if err or not plist: |
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
<!-- This code is public domain, share and enjoy. --> | |
<html> | |
<style type="text/css" media="screen"> | |
#table { | |
position: absolute; | |
top: 30px; | |
bottom: 0; | |
left: 10px; | |
right: 10px; | |
} |
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
// This code is public domain, share and enjoy. | |
window.ui = window.ui || {}; | |
/** @constructor */ | |
ui.ListView = function(element, collection) { | |
this.el = element; | |
this.cellHeight = 30; | |
this.collection = collection; |
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 | |
# This code is public domain, share and enjoy. | |
import random, re, sys, os | |
seed = None | |
if len(sys.argv) > 1: | |
seed = int(sys.argv[1]) |
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 | |
# This code is public domain, share and enjoy. | |
"""Enumerates svn, git, and mercurial repositories in locate database | |
""" | |
from subprocess import Popen,PIPE, check_output | |
import re, os.path |
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 | |
# This code is public domain, share and enjoy. | |
import sys, re | |
rEdge = re.compile(r'(\w+)\s+([\w.*]*)\s*(--|->|<-|<->)\s*([\w.*]*)\s+(\w+)\s*') | |
rName = re.compile(r'\w+') | |
arrows = { |
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
function sortedTable(id) { | |
var table = document.getElementById(id); | |
table.lastColumn = -1; | |
table.onclick = function(ev) { | |
if (ev.target.nodeName == 'TH') { | |
var row = ev.target.parentNode; | |
for (var j=0;j<row.cells.length;j++) { | |
if (row.cells[j] == ev.target) { | |
var rows = []; | |
for (var i=1;i<table.rows.length;i++) { |
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== | |
// @match https://news.ycombinator.com/* | |
// ==/UserScript== | |
(function () { | |
document.body.style.backgroundColor = "#f6f6ef"; | |
var s = document.createElement('style'); | |
s.innerText = "td.default {max-width: 40em; } "+ | |
"body { background-color: #f6f6ef; } "+ | |
".comment { font-size: 12px; } "+ |
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 | |
# Written and placed in the public domain by Steve Dunham | |
# Tries to find footnotes in an epub and transform them into iBooks/epub3 popup footnotes. | |
# | |
# This works with a couple of Terry Pratchett books, it will probably need tweaking for other books. | |
# This script tries to: | |
# | |
# - find the footnote links |
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/local/bin/python3 | |
import re, subprocess, sys | |
if len(sys.argv) < 2: | |
print(''' | |
This utility generates a protobuf file from an Objective C framework. It was developed against | |
CloudKit/CloudKitDaemon, but may work with other libraries that are built the same way. | |
''') | |
print("Usage:\n\t",sys.argv[0],"MachOBinary\n") |
OlderNewer