Skip to content

Instantly share code, notes, and snippets.

Laurent Petit laurentpetit

Block or report user

Report or block laurentpetit

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
@laurentpetit
laurentpetit / simplest_completion_proposal.clj
Last active Aug 30, 2015
Simplest example of providing a custom completion proposal provider for CCW
View simplest_completion_proposal.clj
(use 'ccw.api.content-assist)
(register-completion-proposal-provider!
{:label "Available namespaces"
:provider (constantly ["clojure.core" "clojure.set" "clojure.repl" "clojure.java.io"])})
@laurentpetit
laurentpetit / api-flavor.clj
Last active Aug 29, 2015
working on the API part of CCW. First, facilities to have code executed on the UI thread, asynchronously and non blocking, or blocking (synchronously or asynchronously)
View api-flavor.clj
;; Which solution would be preferred as an API over SWT Display.syncExec Display.asyncExec ?
;; In java you do this:
;; Display.syncExec( -> ...)
;; Display.asyncExec( -> ...)
(require '[ccw.swt :as swt])
;; O
(swt/sync-exec
View pprint-issue.clj
=> (use 'clojure.pprint)
nil
=> (print #'pprint)
#'clojure.pprint/pprint
nil
=> (pprint #'pprint)
#<Var@309f74bd: #<pprint$pprint clojure.pprint$pprint@56b9af2a>>
nil
View gist:42101637cb04f2f064a8
;;;;;;;;;;;;;;;;;;;;;
;; nrepl request when :pprint "true"
{:op "eval", :code "(defn somefn [] (prn \"something\"))", :ns "user", :pprint "true", :right-margin 20}
;; nrepl responses:
{:id a625ffc0-06f2-4fd5-a037-91b265e917b9, :pprint-out #<Var@758d0fe8:
#object[user$somefn 0x1929eceb "user$somefn@1929eceb"]>
, :session fe8e50cf-a399-47c4-8548-860cf540ae80}
{:id a625ffc0-06f2-4fd5-a037-91b265e917b9, :pprint-sentinel {}, :session fe8e50cf-a399-47c4-8548-860cf540ae80}
View gist:b00093e4943928c321d8
------
STATUS
------
pluginId org.eclipse.ui
pluginVersion 3.107.0.v20150423-1329
code 0
severity 4
message Unhandled event loop exception
fingerprint 7dd19923
View gist:7dd34d241a3422e0db55
sample [master●] % tree -a
.
├── .gitignore
├── project.clj
└── src
└── sample
└── core.clj
2 directories, 3 files
sample [master●] % cat project.clj
View gist:90304c86e2dc9c5d817a
classloader: #object[sun.misc.Launcher$ExtClassLoader 0x654d12c2 sun.misc.Launcher$ExtClassLoader@654d12c2]
url: #object[java.net.URL 0x1fb03ff9 file:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/lib/tools.jar]
Exception in thread "Thread-4" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at clojure.lang.RT.classForName(RT.java:2154)
at clojure.lang.RT.classForName(RT.java:2163)
at clojure.lang.RT.loadClassForName(RT.java:2182)
at clojure.lang.RT.load(RT.java:436)
at clojure.lang.RT.load(RT.java:412)
View gist:6f717f4b6677ed6976cb
Exception in thread "Thread-4" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at clojure.lang.RT.classForName(RT.java:2154)
at clojure.lang.RT.classForName(RT.java:2163)
at clojure.lang.RT.loadClassForName(RT.java:2182)
at clojure.lang.RT.load(RT.java:436)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5445.invoke(core.clj:5862)
at clojure.core$load.doInvoke(core.clj:5861)
@laurentpetit
laurentpetit / gist:fb86ea923dfb02e673da
Created May 9, 2015
Execution times for Counterclockwise dependencies. Execution times are written down depth-first.
View gist:fb86ea923dfb02e673da
Execution time: 32ms for LOADING "core_proxy"
Execution time: 130ms for LOADING "core_print"
Execution time: 37ms for LOADING "genclass"
Execution time: 65ms for LOADING "core_deftype"
Execution time: 73ms for LOADING "core/protocols"
Execution time: 41ms for LOADING "gvec"
Execution time: 59ms for LOADING "instant"
Execution time: 21ms for LOADING "uuid"
Execution time: 45ms for LOADING "/clojure/string"
Execution time: 160ms for LOADING "/clojure/java/io"
View gist:4ccd78d01b8aead90f04
> // Field descriptor #9 Ljava/lang/Class;
> private static java.lang.Class __cached_class__0;
>
15c18
< 1 invokespecial clojure.lang.AFunction() [10]
---
> 1 invokespecial clojure.lang.AFunction() [12]
20c23
< // Method descriptor #12 (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
---
You can’t perform that action at this time.