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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>im.mdp.geeknote_watch</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/Users/mdp/.geeknote/sync_notes.sh</string> | |
</array> |
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 localTime(offset) { | |
var d = new Date(); | |
var utc = d.getTime() + (d.getTimezoneOffset() * 60000); | |
return new Date(utc + (3600000*offset)); | |
} | |
localTime(5.5); | |
localTime(-8) |
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
### Keybase proof | |
I hereby claim: | |
* I am mdp on github. | |
* I am mdp (https://keybase.io/mdp) on keybase. | |
* I have a public key whose fingerprint is 3D13 2F63 3496 5AD3 5ECF 8001 8162 FA3B 5DE5 6C9A | |
To claim this, I am signing this 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
### Keybase proof | |
I hereby claim: | |
* I am mdp on github. | |
* I am mdp (https://keybase.io/mdp) on keybase. | |
* I have a public key whose fingerprint is 3D13 2F63 3496 5AD3 5ECF 8001 8162 FA3B 5DE5 6C9A | |
To claim this, I am signing this 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
### Keybase proof | |
I hereby claim: | |
* I am mdp on github. | |
* I am mdp (https://keybase.io/mdp) on keybase. | |
* I have a public key whose fingerprint is E1E8 7928 C499 5D0A E31D 1514 D4BF DAC7 74ED EA2A | |
To claim this, I am signing this 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
# Useful Hash and Array extensions | |
# works well with Sams Extlib | |
# | |
class Hash | |
def with(overrides = {}) | |
self.merge overrides | |
end | |
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/sh | |
# PNGCrush Script | |
# Copyright James Mates -- http://sial.org/blog/scripts/ | |
# Color information stripping added by Mark Percival - http://mpercival.com | |
if [ -z "$1" ]; then | |
echo "Usage: `basename $0` png-image [...]" >&2 | |
exit 1 | |
fi | |
for file in "$@"; do | |
TMPFILE=`mktemp .crush-png-tmp.XXXXXXXX` || exit 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/env bash | |
# mySQL to SQLite3 Conversion Bash Script | |
# | |
# EXAMPLE USAGE: ./mysql2sqlite.sh BDB-sql-2008-03-28.sql | sqlite3 baseball.db | |
# | |
cat $1 | | |
grep -v 'LOCK' | | |
grep -v ' KEY ' | | |
grep -v ' UNIQUE KEY ' | |
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
# RSA encryption via openssl ruby | |
# Shamelessly stolen from Leetsoft.com | |
require 'openssl' | |
module Crypto | |
def self.create_keys(priv = "rsa_key", pub = "#{priv}.pub", bits = 1024) | |
private_key = OpenSSL::PKey::RSA.new(bits) | |
File.open(priv, "w+") { |fp| fp << private_key.to_s } |
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
# OpenSSL RSA Cipher | |
# I always forget this, time to write it down | |
require "openssl" | |
require "base64" | |
private_key = OpenSSL::PKey::RSA.new(1024) | |
key = OpenSSL::PKey::RSA.new(private_key.public_key) |
OlderNewer