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
| ;; Inspired by George Jahad's version: http://georgejahad.com/clojure/debug-repl.html | |
| (defmacro local-bindings | |
| "Produces a map of the names of local bindings to their values." | |
| [] | |
| (let [symbols (map key @clojure.lang.Compiler/LOCAL_ENV)] | |
| (zipmap (map (fn [sym] `(quote ~sym)) symbols) symbols))) | |
| (declare *locals*) | |
| (defn eval-with-locals |
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
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ; Copyright (c) Rich Hickey. All rights reserved. | |
| ; The use and distribution terms for this software are covered by the | |
| ; Common Public License 1.0 (http://opensource.org/licenses/cpl.php) | |
| ; which can be found in the file CPL.TXT at the root of this distribution. | |
| ; By using this software in any fashion, you are agreeing to be bound by | |
| ; the terms of this license. | |
| ; You must not remove this notice, or any other, from this software. | |
| ;dimensions of square world |
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 gltut.importer | |
| (:import [java.lang.reflect Method Field])) | |
| (defn get-methods | |
| "Return all the methods on a class" | |
| [#^Class cls] | |
| (into [] (. cls getMethods))) | |
| (defn get-fields | |
| "Return all the fields on a class" |
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
| ; A set of functions that generates Clojure code which in turn imports | |
| ; static methods from a class. Depends on importer.clj | |
| (ns gltut.macro-generator | |
| (:use [gltut.importer]) | |
| (:require [clojure.string :as s] | |
| [clojure.java.io :as io]) | |
| (:import [org.lwjgl.opengl GL11 GL12 GL13 GL14 GL15 GL20 GL21 GL30 GL31 GL32 | |
| GL33 GL40 ])) |
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
| ; Depends on importer.clj | |
| (ns gltut.glapi (:use [gltut.importer])) | |
| (import-method org.lwjgl.opengl.GL11 glArrayElement gl-array-element) | |
| (import-method org.lwjgl.opengl.GL11 glLineStipple gl-line-stipple) | |
| (import-method org.lwjgl.opengl.GL11 glDrawArrays gl-draw-arrays) | |
| (import-method org.lwjgl.opengl.GL11 glDrawElements gl-draw-elements) | |
| (import-method org.lwjgl.opengl.GL11 glBlendFunc gl-blend-func) | |
| (import-method org.lwjgl.opengl.GL11 glDrawPixels gl-draw-pixels) |
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
| // @name HN Black Font | |
| // @description Make text black on HN | |
| // @homepage https://gist.github.com/1600378/ | |
| // @match https://news.ycombinator.com/* | |
| // @match http://news.ycombinator.com/* | |
| // @run-at document-start | |
| (function() { | |
| var css, head, node; | |
| css = "td { color: #000000; }"; | |
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
| // @name Gumtree location folder | |
| // @description Unfold the location navigation on gumtree | |
| // @match http://www.gumtree.com/* | |
| // @run-at document-start | |
| (function() { | |
| var css, head, node; | |
| css = "#location-tree { display: block !important; } .expandable-tree {visibility: visible !important;}"; | |
| try { | |
| head = document.getElementsByTagName("head")[0]; |
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
| #!/bin/bash | |
| scrot '%Y-%m-%d_%H-%M-%S.png' -s -e 'scp $f [email protected]:www/shotsnb;echo -n "http://leafo.net/shotsnb/$f" | xclip; rm $f' | |
| notify-send -u normal -t 1000 'Screenshot Ready' |
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
| def coroutine(func): | |
| """ | |
| A decorator that turns a function with normal input into a coroutine. | |
| This decorator takes care of priming the coroutine, doing the looping and | |
| handling the closing. | |
| The first argument of any decorated function is what was received when | |
| data was sent to the coroutine via the ``.send`` method. All the other | |
| ``*args`` and ``**kwargs`` are what was passed to the decorated function | |
| when instantiating the coroutine. |
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
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |