Skip to content

Instantly share code, notes, and snippets.


Michał Marczyk michalmarczyk

View GitHub Profile
We couldn’t find that file to show.
View gist:454589
java -cp "d:/xPrograms/leiningen/1.2.0/leiningen-1.2.0-RC2-standalone.jar;src;classes" leiningen.core uberjar
Exception in thread "main" java.lang.Exception: Unable to resolve symbol: defproject in this context (project.clj:1)
at clojure.lang.Compiler.analyze(
at clojure.lang.Compiler.analyze(
at clojure.lang.Compiler$InvokeExpr.parse(
at clojure.lang.Compiler.analyzeSeq(
at clojure.lang.Compiler.analyze(
at clojure.lang.Compiler.analyze(
at clojure.lang.Compiler.eval(
at clojure.lang.Compiler.load(
View gist:454588
lein uberjar error:
lein uberjar
Cleaning up
Exception in thread "main" clojure.lang.LispReader$ReaderException: java.lang.Exception: Invalid token: d:
at clojure.core$read.invoke(core.clj:2872)
at clojure.core$read.invoke(core.clj:2870)
at clojure.main$eval_opt.invoke(main.clj:233)
at clojure.main$initialize.invoke(main.clj:254)
View uglylisp.clj
(def CONS
(fn [a b]
(fn [x]
(if (= x -1)
(if (= x 0)
(def FIRST
View emacsd-tile.el
;; emacsd-tile.el -- tiling windows for emacs
(defun swap-with (dir)
(let ((other-window (windmove-find-other-window dir)))
(when other-window
(let* ((this-window (selected-window))
(this-buffer (window-buffer this-window))
(other-buffer (window-buffer other-window))
(this-start (window-start this-window))
View gist:408622
(def file-info-extractors
{:filename #(.getName #^ %)
:path #(str (.toURI #^ %))
:modified #(.lastModified #^ %)})
(map #(reduce (fn [m [k e]]
(assoc m k (e %)))
(.listFiles ( ".")))
View sawfishstuff.el
(defun get-window-by-class (class)
"Return a window with the given class."
(first (filter-windows #'(lambda (w) (equal (window-class w) class)))))
(defun gimme (cmdline class)
"If a window matching CLASS is found switch to it, else launch cmdline."
(if class
(let ((wnd (get-window-by-class class)))
(if wnd
(display-window wnd)
View gist:386761
(ns clj-swing.core)
(import '(javax.swing JFrame JLabel JTextField JButton JComboBox JPanel Timer)
'(java.awt.event ActionListener)
'(java.awt GridBagLayout GridLayout GridBagConstraints))
(require '[ :as java])
(defmacro combo-box [[& items] & actions]
`(doto (JComboBox.)
View state.clj
(ns state.clj)
(def f
x <- (*read*)
(*write* 42)
y <- (*read*)
(*update* str " was frobnicated!")
View rhino.clj
(set! *warn-on-reflection* true)
(import (org.mozilla.javascript Context NativeObject NativeArray))
(defn js-eval [string]
(let [cx (Context/enter)
scope (.initStandardObjects cx)]
(.evaluateString cx scope string "<js-eval>" 1 nil)))
(defprotocol Clojurify (clojurify [obj]))
You can’t perform that action at this time.