This file contains hidden or 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
java -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n ClassName |
This file contains hidden or 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
(select users | |
(fields :users.first_name) | |
(join user_to_role (= :users_to_roles.user_id :users.id)) | |
(join role (= :users_to_roles.role_id :roles.id)) | |
(fields [:roles.name :role_name])) |
This file contains hidden or 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
mencoder mf://timelapse-*.jpg -mf fps=24:type=jpeg -noskip -of lavf -lavfopts format=mkv -ovc x264 -lavcopts vglobal=1:coder=0:vcodec=x264:vbitrate=100000 -vf eq2=1.2:0.9:0.0:1.0,scale=1280:-2 -o out.mkv |
This file contains hidden or 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 petrglad.machinarium) | |
(defn abs [x] (if (< x 0) (- x) x)) | |
(defmulti sgn type) | |
(defmethod sgn java.lang.Long [x] | |
(if (> x 0) +1 -1)) | |
(defmethod sgn clojure.lang.Keyword [x] | |
(cond | |
(= x :↓) -1 |
This file contains hidden or 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 ['clojure.zip :as 'zip]) | |
(defn hiccup-zip | |
"Returns a zipper for Hiccup forms, given a root form." | |
[root] | |
(let [children-pos #(if (map? (second %)) 2 1)] | |
(zip/zipper | |
vector? | |
#(drop (children-pos %) %) ; get children | |
#(into [] (concat (take (children-pos %1) %1) %2)) ; make new node |
This file contains hidden or 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
package lab; | |
public class LinkedList<T> { | |
class Node { | |
public final T value; | |
public final Node prev; | |
public Node(Node prev, T value) { | |
this.prev = prev; |
This file contains hidden or 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
;;;----------------------------------------------------------------- | |
; From http://clojure.roboloco.net/?tag=paredit | |
(setq inhibit-startup-message t) ;; No splash screen | |
;; (setq initial-scratch-message nil) ;; No scratch message | |
;; (tool-bar-mode nil) ;; No toolbars | |
;; Create backup files in .emacs-backup instead of everywhere | |
(defvar user-temporary-file-directory "~/.emacs-backup") | |
(make-directory user-temporary-file-directory t) | |
(setq backup-by-copying t) |
This file contains hidden or 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
# lines diff | |
git diff --numstat | awk '{print($1 - $2, $3);}' | |
# how much lines added over time | |
git log --author=petr --shortstat --oneline | awk '/^ / {print($4 - $6);}' | awk '{sum += $1} END {print sum;}' |
This file contains hidden or 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
# to attach USB debugger see http://developer.android.com/tools/device.html | |
# to use GPU in emulator | |
ln -s /usr/lib/libGL.so.1 ~/android-sdk-linux_x86/tools/lib/libGL.so |