This file contains hidden or 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
| (ns alephtest.core | |
| (:require [lamina.core :as l]) | |
| (:require [aleph.http :as a]) | |
| (:require [ring.adapter.jetty :as jetty])) | |
| ;; https://github.com/ztellman/aleph | |
| (def counter (atom 0)) | |
| (defn say-hello [] | |
| (let [n (swap! counter inc)] |
This file contains hidden or 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
| // set any object | |
| [[NSUserDefaults standardUserDefaults] setObject:@"this is some string" forKey:@"test"]; | |
| [[NSUserDefaults standardUserDefaults] synchronize]; | |
| // retrieve object | |
| [[NSUserDefaults standardUserDefaults] objectForKey:@"test"]; |
This file contains hidden or 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
| ;; lein settings | |
| (defproject foo "1.0.0-SNAPSHOT" | |
| :description "Test App" | |
| :dependencies [[com.datomic/datomic "0.1.2678"] | |
| [frinj "0.1.2" :exclusions [org.clojure/clojure]]]) | |
| ;; load libs | |
| (use 'frinj.core 'frinj.calc) | |
| (frinj-init!) | |
| (use '[datomic.api :only (q db) :as d]) |
This file contains hidden or 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
| # http://gitready.com/intermediate/2009/02/06/helpful-command-aliases.html | |
| git config --global alias.rb rebase | |
| git config --global alias.st status | |
| git config --global alias.ci commit | |
| git config --global alias.br branch | |
| git config --global alias.co checkout | |
| git config --global alias.df df | |
| git config --global alias.lg log -p | |
This file contains hidden or 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 sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
This file contains hidden or 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
| (ns myreader.core | |
| "Reader Literals Test" | |
| (:require [clojure.string :as str])) | |
| (defn debug-print | |
| "Gauche debug print" | |
| [x] | |
| `(let [res# ~x] | |
| (println "?=" res#) | |
| res#)) |
This file contains hidden or 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
| # Download diffmerge from http://www.sourcegear.com/diffmerge/ | |
| git config --global merge.tool diffmerge | |
| git config --global mergetool.diffmerge.cmd "diffmerge --merge --result=\$MERGED \$LOCAL \$BASE \$REMOTE" | |
| git config --global mergetool.diffmerge.trustExitCode true | |
| git config --global mergetool.keepBackup false | |
| git config --global diff.tool diffmerge | |
| git config --global difftool.diffmerge.cmd "diffmerge \$LOCAL \$REMOTE" |
This file contains hidden or 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
| ;; Datomic example code | |
| (use '[datomic.api :only (db q) :as d]) | |
| ;; ?answer binds a scalar | |
| (q '[:find ?answer :in ?answer] | |
| 42) | |
| ;; of course you can bind more than one of anything | |
| (q '[:find ?last ?first :in ?last ?first] | |
| "Doe" "John") |
This file contains hidden or 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
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains hidden or 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
| Latency Comparison Numbers | |
| -------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns | |
| Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
| Read 4K randomly from SSD* 150,000 ns 0.15 ms |