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
NSURL *artistUrl = [NSURL URLWithString:AebersoldSpotifyUri]; | |
[SPArtistBrowse browseArtistAtURL:artistUrl inSession:[SPSession sharedSession] type:SP_ARTISTBROWSE_NO_TRACKS callback:^(SPArtistBrowse *artistBrowse) { | |
[SPAsyncLoading waitUntilLoaded:artistBrowse timeout:10.0 then:^(NSArray *loaded, NSArray *notLoaded) { | |
for(SPAlbum *a in artistBrowse.albums){ | |
[SPAlbumBrowse browseAlbumAtURL:a.spotifyURL inSession:[SPSession sharedSession] callback:^(SPAlbumBrowse *albumBrowse) { | |
[SPAsyncLoading waitUntilLoaded:albumBrowse timeout:10.0 then:^(NSArray *loadedItems, NSArray *notLoadedItems) { | |
for(SPTrack *t in albumBrowse.tracks){ | |
NSLog(@"%@",t); | |
} | |
}]; |
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
(require '[clojure.java.io :as io]) | |
(defn save-url [url filename] | |
(let [in (io/input-stream (io/as-url url)) | |
out (io/output-stream (io/as-file filename))] | |
(io/copy in out))) |
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 javax.xml.xpath.*; | |
import org.xml.sax.InputSource; | |
public class XcodePath { | |
public static void main(String[] args){ | |
String appcodeOptions = System.getProperty("user.home") + "/Library/Preferences/appCode30/options/other.xml"; | |
String xpathExpression = "/application/component[@name='XcodeSettings']/option[@name='selectedXcode']/@value"; | |
XPathFactory xpathFactory = XPathFactory.newInstance(); | |
XPath xpath = xpathFactory.newXPath(); |
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
(defn setup-midi! | |
[] | |
(.then (.requestMIDIAccess js/navigator) | |
(fn [midi-access] | |
(.forEach (.-outputs midi-access) | |
(fn [o] | |
(let [name (.-name o)] | |
(when (= "IAC" | |
(apply str (take 3 name))) | |
(.then (.open o) |
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
git clone https://github.com/clojure/clojurescript | |
cd clojurescript | |
brew install maven # for building clojurescript | |
./script/build | |
cd .. |
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
(defn js-iterator-to-vec | |
[it] | |
(loop [a []] | |
(if-let [v (-> (.next it) | |
(.-value))] | |
(recur (conj a v)) | |
a))) |
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
// remember to | |
// import EventKit | |
let s = EKEventStore.init() | |
s.requestAccessToEntityType(EKEntityType.Reminder) { (comp, e) -> Void in | |
print(comp,e) | |
let r = EKReminder.init(eventStore: s) | |
r.title = "Testreminder!" | |
let d = NSDate.init().dateByAddingTimeInterval(60) | |
let a = EKAlarm.init(absoluteDate: d) |
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
class osc(pyext._class): | |
t = 0.0 | |
f = 0.0 | |
def bang_3(self): | |
print "SR:",self._samplerate(),"BS:",self._blocksize(),"F:",self.f | |
def _dsp(self): | |
# if _dsp is present it must return True to enable DSP |
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
echo -e "\n\n------------ select from ms sql" | |
sqlcmd -S geotesterapache.cloudapp.net -U sa -P xxx -d skm_test_db -Q "select top 1 * from matrikel" | |
echo -e "\n\n------------ try parsing the spatial data" | |
export C_STR='MSSQL:driver=ODBC Driver 13 for SQL Server;server=geotesterapache.cloudapp.net;database=skm_test_db;UID=sa;PWD=xxx;tables=matrikel' | |
ogrinfo --debug on "$C_STR" -sql "select top 1 * from matrikel" | |
echo -e "\n\n------------ try querying through postgresql" | |
service postgresql start | |
psql -c "create database geotest encoding=UTF8 template=template0;" |
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 SimpleHTTPServer | |
import SocketServer | |
import urllib | |
import re | |
class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def do_GET(self): | |
match = re.search('^/proxy.ashx?\?url=(.+)$',self.path) | |
if match: | |
self.send_response(200) |
OlderNewer