Skip to content

Instantly share code, notes, and snippets.

View mikera's full-sized avatar

Mike Anderson mikera

View GitHub Profile
@joinr
joinr / dataset.clj
Created August 30, 2017 10:51
Extending incanter's dataset protocols to a different implementation from spork.util.table
;;Compatibility layer to extend spork.util.table usage
;;into incanter datasets (as of 1.9.1).
;;Since datasets are now based on an API in clojure.core.matrix,
;;we can extend the API to use our table functions. This should
;;eliminate the trouble we've have processing incanter
;;datasets effeciently, since we can parse spork tables
;;using schemas.
(ns proc.dataset
(:require [spork.util [table :as tbl]]
[clojure.core.matrix.protocols :as mp]
anonymous
anonymous / ArrayGet.java
Created April 1, 2016 13:25
package bench;
import org.openjdk.jmh.annotations.*;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.invoke.MutableCallSite;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
@rogerallen
rogerallen / 0_tweegeemee.txt
Last active November 9, 2015 04:20
twee gee mee archive
Archive of the code for images posted to https://twitter.com/tweegeemee
Started Aug 30, 2015
Learn more at https://github.com/rogerallen/tweegeemee
@rogerallen
rogerallen / 0_tweegeemee.txt
Last active August 30, 2015 19:59
twee gee mee archive
Archive of the code for images posted to https://twitter.com/tweegeemee
Learn more at https://github.com/rogerallen/tweegeemee
@rogerallen
rogerallen / 0_tweegeemee.txt
Last active August 29, 2015 14:22
twee gee mee archive
Archive of the code for images posted to https://twitter.com/tweegeemee
Learn more at https://github.com/rogerallen/tweegeemee
(ns ical.core
(:require
[om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[sablono.core :as html :refer-macros [html]]))
(enable-console-print!)
(def weekdays ["saturday" "monday" "tuesday" "wednesday" "thursday" "friday" "sunday"])
@lynxluna
lynxluna / fb-lite.clj
Created August 17, 2014 05:17
Minimalist Facebook Graph API Client
;; Depends on clj-http and cheshire
(ns com.ykode.social.fb-lite
(:require [clj-http.client :as client]
[cheshire.core :refer [parse-string]]))
(defn- fburl [ext] (str "https://graph.facebook.com/" ext))
(defn- auth-get
[access-token url]
@ctford
ctford / map.clj
Created May 30, 2014 21:15
An alternative implementation of map that won't silently return nils for missing keys.
(ns strict-map.map)
(deftype StrictMap [inner]
clojure.lang.IPersistentMap
(assoc [this k v]
(StrictMap. (.assoc inner k v)))
(assocEx [this k v]
(StrictMap. (.assocEx inner k v)))
(without [this k]
(StrictMap. (.without inner k)))
@candera
candera / ssh-repl.org
Last active February 9, 2019 07:50
ssh-repl

Embedding an SSH-accessible REPL in a Clojure process

N.B. This is now a library, thanks to the efforts of the wonderful @mtnygard. And the README does a good job of making clear just how terrible an idea it is to actually do this. :)

As any Clojurist knows, the REPL is an incredibly handy development tool. It can also be useful as a tool for debugging running programs. Of course, this raises the question of how to limit access to the REPL to authorized parties. With the Apache SSHD library, you can embed an SSH server in any JVM process. It takes only a little code to hook this up to a REPL, and to limit access either by public key or

@rm-hull
rm-hull / chess.cljs
Last active August 29, 2015 13:56
OM version of Garry Kasparov - Veselin Topalov ; Hoogovens A Tournament Wijk aan Zee NED 1999.01.20 - adapted from https://raw2.github.com/danieroux/rubyfuza2014/master/src/rubyfuza/core.cljs
; Adapted from https://raw2.github.com/danieroux/rubyfuza2014/master/src/rubyfuza/core.cljs
(ns rubyfuza.core
(:require-macros
[cljs.core.async.macros :refer [go]])
(:require
[clojure.string :as str]
[om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[cljs.core.async :as async :refer [put! chan <! >! timeout]]))