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
(clojure.core.async/go | |
(let [sleepy-val (fn [v t] (clojure.core.async/go | |
(clojure.core.async/<! (clojure.core.async/timeout t)) | |
v)) | |
chans (clojure.core.async/merge (map #(sleepy-val % (rand-int 3000)) | |
(range 10)))] | |
(while (when-let [v (clojure.core.async/<! chans)] | |
(prn v) | |
v)))) |
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
ls -1|sed -e "s/'/\\\'/g" -e "s/.flac//g"|xargs -I{} avconv -i {}.flac -c:a libmp3lame -b:a 256k {}.mp3 |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines or lines starting with space in the history. | |
# See bash(1) for more options | |
HISTCONTROL=ignoreboth |
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
! xscreensaver --------------------------------------------------------------- | |
!font settings | |
xscreensaver.Dialog.headingFont: -*-dina-bold-r-*-*-10-*-*-*-*-*-*-* | |
xscreensaver.Dialog.bodyFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-* | |
xscreensaver.Dialog.labelFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-* | |
xscreensaver.Dialog.unameFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-* | |
xscreensaver.Dialog.buttonFont: -*-dina-bold-r-*-*-10-*-*-*-*-*-*-* | |
xscreensaver.Dialog.dateFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-* | |
xscreensaver.passwd.passwdFont: -*-dina-bold-r-*-*-10-*-*-*-*-*-*-* |
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
set nocompatible | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/Vundle.vim' | |
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 update-at | |
"Takes a structure, a function that returns a list of paths (lists of keys) and a | |
function to apply at those paths within the structure. | |
For any paths that don't already exist in m, then f will be called with nil | |
and that path in the structure will be created with the result." | |
[m path-generation-fn f] | |
(reduce (fn [s v] (update-in s v f)) | |
m | |
(path-generation-fn m))) |
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
https://twitter.com/pyr "talking about #mesos and mesomatic: the cluster is a library" | |
https://twitter.com/AdamTornhill "Beyond Code: Repository Mining with #Clojure" | |
https://twitter.com/kachayev "Reinventing Haxl: Efficient, Concurrent and Concise Data Access" | |
https://twitter.com/ifesdjeen "Clojure is a sweet spot for Analytics" | |
https://twitter.com/mtrimpe "building Elephant 2000, McCarthy’s programming language for 2015, using Clojure" |
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
[alias] | |
st = status | |
lg = log | |
ci = commit -v | |
co = checkout | |
br = branch | |
# View stash diffs - use n to go to the next stash and N to go to the previous stash | |
stp = "!IFS=$'\n';for stash in $(git stash list);do echo $stash;echo;git --no-pager diff --color=always $(echo $stash|cut -f1 -d:);done|less -pstash" |
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 i in $(seq 255); | |
do | |
nslookup 192.168.1.$(echo $i) 192.168.1.1 >/dev/null; | |
if [ $? -ne 1 ]; | |
then | |
echo -n 192.168.1.$i; | |
nslookup 192.168.1.$(echo $i) 192.168.1.1|grep name|cut -d= -f2; | |
fi; | |
done |
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
;; @andrew_jones mentioned this from Miller and Vandgrift's Applied Clojure book | |
;; unusual how the varargs were being destructured as if they were a map | |
((fn [& opts] (let [{:keys [a b c]} opts] (str a b c))) :a 1 :b 2 :c 3);;=>"123" | |
;; opts is a list, not a vector | |
(let [{:keys [a b c]} '(:a 1 :b 2 :c 3)] (str a b c));;=>"123" | |
(let [{:keys [a b c]} [:a 1 :b 2 :c 3]] (str a b c));;"" | |
(let [{:keys [a b c]} [[:a 1] [:b 2] [:c 3]]] (str a b c));"" |
OlderNewer