Skip to content

Instantly share code, notes, and snippets.

Michał Marczyk michalmarczyk

Block or report user

Report or block michalmarczyk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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(Compiler.java:5200)
at clojure.lang.Compiler.analyze(Compiler.java:5146)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3031)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:5366)
at clojure.lang.Compiler.analyze(Compiler.java:5185)
at clojure.lang.Compiler.analyze(Compiler.java:5146)
at clojure.lang.Compiler.eval(Compiler.java:5423)
at clojure.lang.Compiler.load(Compiler.java:5852)
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.lang.LispReader.read(LispReader.java:180)
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)
'CONS
(if (= x 0)
a
b)))))
(def FIRST
View emacsd-tile.el
;; emacsd-tile.el -- tiling windows for emacs
(defun swap-with (dir)
(interactive)
(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 #^java.io.File %)
:path #(str (.toURI #^java.io.File %))
:modified #(.lastModified #^java.io.File %)})
(map #(reduce (fn [m [k e]]
(assoc m k (e %)))
{}
file-info-extractors)
(.listFiles (java.io.File. ".")))
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 '[clojure.contrib.java-utils :as java])
(defmacro combo-box [[& items] & actions]
`(doto (JComboBox.)
View state.clj
(ns state.clj)
(comment
(def f
(statefully
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.