I hereby claim:
- I am viesti on github.
- I am viesti (https://keybase.io/viesti) on keybase.
- I have a public key ASB3ZVN7e3l1zmGJt3jyoS9DKhRU18qwmhRiif0a1r2qZgo
To claim this, I am signing this object:
| (ns myapp.test | |
| (:require [cljs.test :as test :refer-macros [deftest is] :refer [report]])) | |
| (enable-console-print!) | |
| (defmethod report [:karma :begin-test-ns] [m] | |
| (println "\nTesting with Karma" (name (:ns m)))) | |
| (defmethod report [:karma :summary] [m] | |
| (println "All done")) |
| (println (str "goog._dependencies.nameToPath count: " (count (js->clj (.. js/goog -dependencies_ -nameToPath ))))) | |
| (println (str "i18 stuff: " (count (filter #(re-find #".*i18.*" (name (key %))) (js->clj (.. js/goog -dependencies_ -nameToPath )))))) | |
| goog._dependencies.nameToPath count: 5314 | |
| i18 stuff: 3543 |
| (ns karma.macros | |
| (:require [cljs.analyzer.api :as ana-api])) | |
| (defmacro ns-metas [re] | |
| (mapv (fn [ns] | |
| `(ns-interns ~['quote ns])) | |
| (filter #(re-matches re (str %)) | |
| (ana-api/all-ns)))) | |
| ----------------------------------------------------------------- |
| def make_rules(hosts, ports, proto): | |
| return [{"proto": proto, | |
| "from_port": port, | |
| "to_port": port, | |
| "cidr_ip": host} for host in hosts for port in map(int, ports.split(","))] | |
| class FilterModule(object): | |
| def filters(self): | |
| return {'make_rules': make_rules} |
| #!/usr/bin/python | |
| from boto.ec2 import connect_to_region | |
| from boto.ec2.group import Group | |
| def main(): | |
| module = AnsibleModule( | |
| argument_spec = dict( | |
| ec2_id = dict(required=True), | |
| group_names = dict(required=True), |
| user=> (->> (range 20) (drop 3) (filter odd?) (take 5)) | |
| (3 5 7 9 11) | |
| user=> (into [] (comp (drop 3) (filter odd?) (take 5)) (range 20)) | |
| [3 5 7 9 11] |
I hereby claim:
To claim this, I am signing this object:
| ;; Solves math excercise: | |
| ;; 9 = 5 [ ] 3 [ ] 4 [ ] 5, | |
| ;; , where [ ] should be one of operations: +, - | |
| ;; Uses just random brute force :) | |
| user> (def ops #{+ -}) | |
| user> (loop [cnt 0 | |
| op1 (first ops) | |
| op2 (first ops) | |
| op3 (first ops)] |
| (spit "talk-samples.html" (format "<html><head><style>%s</style></head><body>%s</body></html" | |
| (g/generate-css (-> glow.colorschemes/solarized-dark | |
| (dissoc :background) | |
| (assoc :symbol "#0b2a34") | |
| (assoc :string "#1f7a73"))) | |
| (g/highlight-html (slurp "talk-samples.clj")))) |
| import boto3 | |
| import zlib | |
| def decompress_object(bucket, key, out_file): | |
| s3 = boto3.client("s3") | |
| body = s3.get_object(Bucket=bucket, Key=key)['Body'] | |
| with open(out_file, "ab") as out: | |
| decompressor = zlib.decompressobj(zlib.MAX_WBITS|32) | |
| for chunk in body.iter_chunks(): | |
| out.write(decompressor.decompress(chunk)) |