Skip to content

Instantly share code, notes, and snippets.

@seryh
seryh / find-unused-clj.sh
Created May 18, 2017 04:30 — forked from joelittlejohn/find-unused-clj.sh
Very quick and dirty command to find unused functions and vars in a Clojure project
#!/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$"
(defn- nils-factory
([] (nils-factory nil))
([data] (lazy-seq (cons data (nils-factory)))))
;; (take 300 (repeat nil)) || (take 300 (nils-factory))
// 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() {};
(ns iway.utils)
(def ^:const TYPE-PLACES {0 :RENT
1 :SUBURB
2 :AIRPORT
3 :STATION
4 :NEAR
5 :LOCALITY
6 :OTHER
7 :MKAD
(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)
#_(: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
[
{"$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}},
{
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
(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)