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 inlein | |
'{:dependencies [[org.clojure/clojure "1.8.0"] | |
[hiccup "1.0.5"]]} | |
(require '[hiccup.page :as hic-p]) | |
;; Note, some :td's may contain links, or have | |
;; attributes, or both. | |
(def tbl [:table {:stuff "yo"} |
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
$ panda install Readline | |
==> Fetching Readline | |
==> Building Readline | |
==> Testing Readline | |
===SORRY!=== Error while compiling /home/john/.panda-work/1451502005_1/lib/Readline.pm | |
In 'remove_history' routine declaration - Not an accepted NativeCall type for parameter [1] : Int | |
-->For Numerical type, use the appropriate int32/int64/num64... | |
at /home/john/.panda-work/1451502005_1/lib/Readline.pm:769 | |
===SORRY!=== Error while compiling /home/john/.panda-work/1451502005_1/lib/Readline.pm | |
In 'remove_history' routine declaration - Not an accepted NativeCall type for parameter [1] : Int |
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 lein-exec | |
(def people | |
#{{:id 1 :name "Gorf"} | |
{:id 2 :name "Riff"} | |
{:id 3 :name "Raff"} | |
;; ... snip lots more | |
{:id 10000 :name "Grum"}}) | |
;; Quick, find Raff's id! |
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 perl | |
use Modern::Perl; | |
use autodie qw/:all/; | |
use File::Copy; | |
my @tar_files = glob '*.tar'; # All the tar files in the curr dir. | |
unless (@tar_files) { | |
die "No tar files here. Exiting!\n"; |
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.data.codec.base64 :as base64]) | |
;;--------------------------------------------------- | |
;; From <http://en.wikipedia.org/wiki/Base64> | |
(def input "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz | |
IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg | |
dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu | |
dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo | |
ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=") |
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 lein-run | |
(require '[cemerick.pomegranate :as pome]) | |
(pome/add-dependencies | |
:coordinates '[[org.clojure/math.combinatorics "0.0.4"]] | |
:repositories (merge cemerick.pomegranate.aether/maven-central | |
{"clojars" "http://clojars.org/repo"})) | |
(require '[clojure.math.combinatorics :as combo]) |
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
(def items ["florian" "fluid" "flack" "flask" "flan"]) | |
;; Find the item that begins with "flu". | |
(println (first (filter (fn [s] | |
(re-find #"^flu" s)) | |
items))) |
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 | |
lein run -m clojure.main/main -i "$@" |
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 'leiningen.exec) | |
(leiningen.exec/deps '[[org.clojure/math.combinatorics "0.0.4"]]) | |
(require '[clojure.math.combinatorics :as combo]) | |
(println | |
(combo/combinations [1 2 3] 2)) |
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/java -jar /home/john/opt/clojure-1.5.1/clojure-1.5.1.jar | |
(println "hi") |