Skip to content

Instantly share code, notes, and snippets.

View jetsanix's full-sized avatar
💭
💭💭💭

jet tsang zeon-git jetsanix

💭
💭💭💭
View GitHub Profile
{
"Python": {
"python": '/usr/bin/python',
"pythonExtraPaths": ["/Users/YourUsername/PythonPath"]
},
"Python3": {
"python": '/usr/bin/python3',
"pythonExtraPaths": ["/Users/YourUsername/Python3Path"]
}
}
@jetsanix
jetsanix / reset_app_store.sh
Created July 26, 2012 00:19
Reset the App Store on Os X Mountain Lion
#!/bin/sh
rm ~/Library/Preferences/com.apple.appstore.plist
rm -r ~/Library/Saved\ Application\ State/com.apple.appstore.savedState
rm -r ~/Library/Caches/com.apple.appstore
rm -r /private/var/folders/*/*/*/com.apple.appstore
@jetsanix
jetsanix / html5-notifications.md
Created July 12, 2012 09:22
OS X Notification Center in Safari 6 & Chrome 21+

OS X Notification Center in Safari 6 & Chrome 21+

OS X Mountain Lion adds Notification Center for managing alerts. Just like growl, but better.

Safari 6 and latest Chrome (21+) expose HTML5 notifications API to sites. Every site need to have permission for showing notifications.

Specification is very new and completely different from older version Chrome had. Developer doesn't have to watch for complicated NotificationCenter.

The syntax is very simple:

@jetsanix
jetsanix / alphatown.js
Created August 31, 2011 20:22
alphatown map on
/* paste and run on chrome */
for(i=100;i<6000;i++){
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","http://alphatown.com/api/node/"+i+"/info?sync=true&d=1314820793143&p=&w=191&oz_tm=_alphatown_api_handler______3380______1314820793143",true);
xmlhttp.send();
}
@jetsanix
jetsanix / parallets.sh
Created August 9, 2011 05:50
Parallels on lion
#!/bin/sh
sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_hypervisor.kext"
sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_hid_hook.kext"
sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_usb_connect.kext"
sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_netbridge.kext"
sudo kextutil "/Library/Parallels/Parallels Service.app/Contents/Kexts/10.6/prl_vnic.kext"
from subprocess import Popen,PIPE
import re
import time
import sqlite3
CONCURRENCY_ALLOWED = 30
OUTDATE_TIME = 86400
# initializing database
db = sqlite3.connect("/tmp/ddos.db3")