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
user> (def a (agent 100)) | |
#'user/a | |
user> @a | |
100 | |
user> (agent-error a) | |
nil | |
user> (send a + 100) | |
#<Agent@73cc11: 100> | |
user> @a | |
100 |
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
#(every? true? (map = % (reverse %))) |
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 test-with-google [] | |
(let [driver (FirefoxDriver.)] | |
(.get driver "http://www.google.com/") | |
(println "Original page title is " (.getTitle driver)) | |
(let [element (.findElement driver (By/name "q"))] | |
(.sendKeys element (into-array ["clojure\n"])) | |
(.submit element) | |
(-> (WebDriverWait. driver 10) | |
(.until (proxy [ExpectedCondition] [] | |
(apply [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
#!/bin/bash | |
### INSTALLATION: | |
### Add the following 4 lines to your .bashrc or .bash_profile | |
### # source the sublimerc file if it exists | |
### if [ -f "${HOME}/.sublimerc" ] ; then | |
### source "${HOME}/.sublimerc" | |
### fi | |
### | |
### Strip off the leading "### " of course. |
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
[Desktop Entry] | |
Version=1.0 | |
Type=Application | |
Terminal=false | |
Name=Sublime Text 2 | |
GenericName=Text Editor | |
Comment=View and edit files | |
Exec=/home/mark/SublimeText2/sublime_text %F | |
Icon=/home/mark/SublimeText2/Icon/128x128/sublime_text.png | |
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;text/x-clj;text/x-cljs |
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
#!/Users/mnutter/.rvm/rubies/ruby-2.0.0-p247/bin/ruby | |
def toCamel(s) | |
while s =~ /([^_]+)_(.)(.*)$/ do | |
s = $1 + $2.upcase + $3 | |
end | |
return s | |
end | |
def toSnake(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
(ns share-for-all.routes.auth | |
;; ... | |
(:require ;; ... | |
[cemerick.friend :as friend] | |
(cemerick.friend [workflows :as workflows] | |
[credentials :as creds]))) | |
;; ... | |
(defroutes secured-routes | |
(GET "/register" req |
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
upstream http_backend { | |
server localhost:33333; | |
keepalive 32; | |
} | |
server { | |
listen 3333 default_server; | |
server_name localhost; |
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- lock [handler] | |
(friend/requires-scheme handler :https {:http 3333 | |
:https 3334})) | |
(defroutes sensitive-routes | |
(GET "/register" [] | |
(layout/render "auth/register.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
Erlang R16B01 (erts-5.10.2) [source-bdf5300] [async-threads:10] [hipe] [kernel-poll:false] | |
Interactive Elixir (0.10.1-dev) - press Ctrl+C to exit (type h() ENTER for help) | |
iex(1)> 1 + 3 | |
4 | |
... | |
iex(5)> a = "foo" | |
"foo" | |
iex(6)> 8 + a | |
** (ArithmeticError) bad argument in arithmetic expression |
OlderNewer