Skip to content

Instantly share code, notes, and snippets.

View kennethkalmer's full-sized avatar

Kenneth Kalmer kennethkalmer

View GitHub Profile
@robert-stuttaford
robert-stuttaford / datomic.clj
Last active April 27, 2018 15:10
Handy protocols for working with Datomic
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Connection
(defprotocol DatomicConnection
(as-conn [_]))
(extend-protocol DatomicConnection
datomic.Connection
(as-conn [c] c)
datomic.db.Db
(ns creator.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [om.core :as om :include-macros true]
[cljs.core.async :as async :refer [chan <! >! put!]]
[om-tools.core :refer-macros [defcomponent]]
[cljs.reader :as reader]
[goog.dom :as gdom]
[om-tools.dom :as dom :include-macros true])
(:import [goog.net XhrIo]))
@john2x
john2x / 00_destructuring.md
Last active February 20, 2025 05:30
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@jafingerhut
jafingerhut / inputstream.clj
Created July 8, 2014 15:01
Example of reading java.io.InputStream in Clojure
(ns inputstream.core
(:require [clojure.java.io :as io]))
(defn read-is [^java.io.InputStream is]
(let [bufsize 8192
buf (byte-array bufsize)]
(loop [total-len 0]
(let [n (.read is buf)]
(cond
@kennethkalmer
kennethkalmer / README.md
Last active August 29, 2015 14:02
School Online Bootstrap Guide/Kit

Kudos to @paulscott56 for the cool name. It all started on twitter.

School Online Bootstrap Guide/Kit

School websites suck, actually, schools suck at being online. But in reality, schools don't need much to be online. 99/100 times the minimum viable school site might just be single static page with contact information, links to FB and/or Twitter. Oh, and a "add my to the mailing list" feature, cause that would be better...

The sad thing is that currently we have three camps, maybe more:

  1. Schools getting exploited by unsavoury IT companies and paying big bucks for mediocre FOSS deployments with Corel Draw graphics.
  2. Schools teachers acting defensively against anyone who is better than them at operating Dreamweaver
@gee-forr
gee-forr / links.md
Last active August 29, 2015 14:01
Some links for more reading from my talk on Job Stories
@wbroek
wbroek / genymotionwithplay.txt
Last active February 13, 2025 09:37
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
class FriendlyGuid
attr_reader :mask
def initialize(mask)
@mask = mask
end
def guid(id)
(id.to_i ^ mask).to_s(36)
end
@tomconnors
tomconnors / gist:8460406
Created January 16, 2014 18:25
Handling keyboard input with React and clojurescript
;;; I'm not using Om yet because I've got a lot of code using Pump and just haven't made the transition,
;;; but the principles are all the same. So you'll see Pump-specific code here.
(def code->key
"map from a character code (read from events with event.which)
to a string representation of it.
Only need to add 'special' things here."
{13 "enter"
37 "left"
38 "up"
@adamico
adamico / collection_check_boxes_input.rb
Last active January 17, 2025 21:21 — forked from mattclar/simple_form.rb
This fork adds a custom horizontal form wrapper and merges append/prepend in a 'group' wrapper
#app/inputs/collection_check_boxes_input.rb
class CollectionCheckBoxesInput < SimpleForm::Inputs::CollectionCheckBoxesInput
def item_wrapper_class
"checkbox-inline"
end
end