Skip to content

Instantly share code, notes, and snippets.

(fn [cards]
(let [card-type (fn [input]
(let [[suit rank] (rest
(clojure.string/split input #""))
suits {"D" :diamond
"H" :heart
"C" :club}
ranks (zipmap (map
str '[2 3 4 5 6 7 8 9 T J Q K A])
(range 13))]
FROM ubuntu
RUN apt-get update
RUN apt-get install -qq -y wget python-software-properties software-properties-common zip curl ruby1.9.1
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
RUN apt-get install -qq -y oracle-java7-installer
(defn percentiles [xs]
(let [sorted (sort xs)
how-many (count sorted)
percentile (fn [n]
(let [idx (Math/floor (* how-many (/ n 100)) )]
(nth sorted idx)))]
{:mean (mean xs)
:median (percentile 50)
:90 (percentile 90)
:95 (percentile 95)
user> (def a [[1 2] [3 4] [5 6]])
#'user/a
user> (def b [[1 7] [2 8] [5 6]])
#'user/b
user> (map (fn [[a b] [c d]]
(if (= a c)
[b d]))
a
(expect (partial apply =)
(from-each [[result sexp] {
3 3
true true
2 '(+ 1 1)
;; POTENTIALLY LOADS MORE EGS
}
]
[result (eval sexp)]))
#!/bin/bash
FILES="*.avi"
mkdir mp3
for i in $FILES; do
ffmpeg -i "$i" -ab 320k "mp3/${i%%.avi}.mp3"
#mplayer -dumpaudio "$i" -dumpfile "mp3/${i%%.avi}.mp3"
done
for i in range(1, 101):
print("")
if i % 3 == 0:
print ("fizz",end='')
if i % 5 == 0:
print ("buzz",end='')
if (i%3 != 0 and i%5 != 0 ):
print (i,end='')
:: USES UNICA from http://www.gourami.eu/products/unica
:: and filever from the supportkit
@echo off
::
set version=
if not exist "C:\Program Files\Citrix\ICA Client\pnagent.exe" goto install
:checkversion
for /f "Tokens=5" %%a in ('\\dc01-nacifs-01\cifs\XenAppClient11.2\filever.exe "C:\Program Files\Citrix\ICA Client\pnagent.exe"') do set version=%%a
::echo %version%
if %version% == 11.2.0.31560 goto :end
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\PNAgent]
"ServerURL"="http://SERVERNAME/Citrix/PNAgent/config.xml"
"EnablePassThrough"=dword:00000001
(add-to-list 'load-path
"~/.emacs.d/yasnippet")
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/yasnippet/snippets")
(defun color-theme-blackboard ()
"Color theme by JD Huntington, based off the TextMate Blackboard theme, created 2008-11-27"
(interactive)
(color-theme-install