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 lumo | |
(ns spacedl.spacedl | |
(:require [cljs.nodejs :as node] | |
[clojure.pprint :refer [pprint]] | |
[clojure.string :as string :refer [join split starts-with?]] | |
[lumo.core :refer [*command-line-args*]])) | |
(node/enable-util-print!) | |
(.on js/process "uncaughtException" #(js/console.error %)) |
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 | |
for f in $(egrep -o -R "defn?-? [^ ]*" * --include '*.clj' | cut -d \ -f 2 | sort | uniq); do | |
echo $f $(grep -R --include '*.clj' -- "$f" * | wc -l); | |
done | grep " 1$" |
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- nils-factory | |
([] (nils-factory nil)) | |
([data] (lazy-seq (cons data (nils-factory))))) | |
;; (take 300 (repeat nil)) || (take 300 (nils-factory)) |
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
// Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem | |
// throw QuotaExceededError. We're going to detect this and just silently drop any calls to setItem | |
// to avoid the entire page breaking, without having to do a check at each usage of Storage. | |
if (typeof localStorage === 'object') { | |
try { | |
localStorage.setItem('localStorage', 1); | |
localStorage.removeItem('localStorage'); | |
} catch (e) { | |
Storage.prototype._setItem = Storage.prototype.setItem; | |
Storage.prototype.setItem = function() {}; |
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 iway.utils) | |
(def ^:const TYPE-PLACES {0 :RENT | |
1 :SUBURB | |
2 :AIRPORT | |
3 :STATION | |
4 :NEAR | |
5 :LOCALITY | |
6 :OTHER | |
7 :MKAD |
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
(deftest test-route | |
"nextgen" | |
(let [] | |
(click (find-element (first (find-elements {:css ".iw-nextgen-global-view .iw-multifinderwidget-box"})) | |
{:css ".iw-multifinderwidget-place-title"})) | |
(Thread/sleep 500) |
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 [hickory.core :as hic] | |
[hickory.select :as s] | |
[clojure.xml :as xml]) | |
(defn players->xml [] | |
(let [html (:body (client/post "http://myvolley.ru/servlet/playersearch" | |
{:form-params {:sex 0 | |
:numt 10 | |
:t_status 0 | |
:day 22 |
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
[ | |
{"$match": { | |
"date": { | |
"$gte":"2016-03-11 18:00:00", | |
"$lte":"2016-04-11 18:00:00" | |
}, | |
"userID": 102} | |
}, | |
{ "$project" : {"fDate":{"$add": ["$date", 21600000]}, "stats":1, "date": 1, "userID": 1}}, | |
{ |
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
# .bash_profile | |
# Get the aliases and functions | |
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
# User specific environment and startup programs | |
PATH=$PATH:$HOME/bin |
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 data-sum [^bytes data] | |
(let [count-data (count data)] | |
(loop [i 0 sum 0] | |
(let [val (hx/get-byte data i) | |
new-sum (+ sum val)] | |
(if (< i (dec count-data)) | |
(recur (inc i) new-sum) new-sum))))) | |
(defn valid-CS? [^bytes data] | |
(let [count-data (count data) |