Skip to content

Instantly share code, notes, and snippets.

View nicokosi's full-sized avatar

Nicolas Kosinski nicokosi

View GitHub Profile
@nicokosi
nicokosi / clojure-nightclazz.clj
Last active December 30, 2015 11:09
Code from Zenika session for Clojure beginners ("NightClazz" session, 2013/12/05). This is just a backup, see repo https://github.com/nicokosi/clojure-nightclazz.
(ns nightclazz.gameOfLife
(:require [quil.core :as q]))
;; generation:
(def world (atom
#{[0 1] [1 2] [1 1] [1 3]}))
(defn setup []
(q/smooth)
(q/background 30))
@nicokosi
nicokosi / debian-package-mgt.sh
Last active October 13, 2016 11:15
Cheat sheet for Debian Linux package management
# install '.deb' package (local file)
dpkg -i my-package
# list installed packages
dpkg-query -W
# list installed ('ii' marker) and not installed ('un') packages
dpkg -l
# list available packages
@nicokosi
nicokosi / DummyFileGenerator.groovy
Last active December 16, 2015 22:49
Groovy script that generates a text file
out = new File("C:/tmp/output.txt")
out.write "-- Dummy file header\n"
for (index in 1..5) {
out.append "line${index}\n"
}
println "Generated file ${out}."
@nicokosi
nicokosi / memo.sh
Last active September 22, 2016 03:20
Basic Unix commands
# File basics:
############################
# list files, sorted by update date (recent last)
ls -rclt
# list files, sorted by update date (recent first)
ls -clt
# (recursive) folder sizes
du -h -d1 # human-readable sizes + dir depth of 1
(defn lazy-inc [x]
(lazy-seq
(print ".")
(cons x (lazy-inc (inc x)))))
(print "\n take 2: ")
(take 2
(lazy-inc 1))
(print "\n first: ")