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
{ | |
"metadata": { | |
"kernelspec": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 2 | |
}, | |
"display_name": "IPython (Python 2)", | |
"language": "python", | |
"name": "python2" |
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 | |
from sampy import * | |
import time | |
from pprint import pprint | |
# Setup hub by calling "start_samp_hub.py", it would contain: | |
# myhub = SAMPHubServer() | |
# myhub.start(True) # The True makes the script standalone; it should be called with | |
# alternatively, sampy (/usr/local/bin/sampy, for instance) can be called: | |
import subprocess |
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
on downloadUrl(theUrl, fileName) | |
set curlCmd to "curl -s -L -o " & fileName & " '" & theUrl & "' " | |
--display dialog curlCmd | |
do shell script curlCmd | |
end downloadUrl | |
on run {input, parameters} | |
set theUrls to {} | |
repeat with kmlFile in input |
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 ruby | |
# PBS 4 Dec. 2013 | |
# Renders HTML for all the .markdown files in the current directory. | |
# Gives each file a .html suffix. | |
# Saves them in a subfolder called HTML. | |
require 'rdiscount' | |
require 'find' | |
require 'fileutils' |
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 ruby | |
require "fileutils" | |
require "redcarpet" | |
OUTPUT_FOLDER = "html" | |
HTML_TEMPLATE = <<-HTML | |
<!DOCTYPE html> | |
<html> |
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 script only works in Mac OS X, due to the dependency | |
# on the `open` command. | |
# It can be directly added into a .profile file, either | |
# by copying and pasting its content, or sourcing the | |
# file: | |
# . search_functions.sh | |
# Usage: google any search terms | |
# Result: default browser opens with a query on any |
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
scp yzhang@linux04.cs.uh.edu:~/packages/scidb-15.7.0.9267.tgz ./ | |
tar -xzf scidb-15.7.0.9267.tgz | |
mv scidb-15.7.0.9267/ scidbtrunk | |
sudo apt-get update | |
sudo apt-get -y install subversion expect openssh-server openssh-client | |
# The following environment variables should go into ~/.bashrc | |
export SCIDB_VER="15.7" | |
export SCIDB_SOURCE_PATH="/home/scidb/scidbtrunk" |
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
import CloudKit | |
iCloudUserIDAsync() { | |
recordID, error in | |
if let userID = recordID?.recordName { | |
print("received iCloudID \(userID)") | |
} else { | |
print("Fetched iCloudID was nil") | |
} | |
} |
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
import CloudKit | |
/// async gets iCloud record ID object of logged-in iCloud user | |
func iCloudUserIDAsync(complete: (instance: CKRecordID?, error: NSError?) -> ()) { | |
let container = CKContainer.defaultContainer() | |
container.fetchUserRecordIDWithCompletionHandler() { | |
recordID, error in | |
if error != nil { | |
print(error!.localizedDescription) | |
complete(instance: nil, error: error) |
OlderNewer