Skip to content

Instantly share code, notes, and snippets.

@jmacias
jmacias / reagent_datascript.cljs
Created October 29, 2015 16:08 — forked from allgress/reagent_datascript.cljs
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@jmacias
jmacias / core.cljs
Created October 22, 2015 18:20 — forked from sgrove/core.cljs
ReactMotion + ClojureScript
(ns motionable.core
(:require [om.core :as om]
[om.dom :as dom]
[React :as r :refer [createElement createClass render]]
[ReactMotion :as rm]))
(enable-console-print!)
(def app-state
(atom {:text "Hello world!"}))
@jmacias
jmacias / es7coreasync.md
Created September 25, 2015 21:25 — forked from shaunlebron/es7coreasync.md
es7 vs core.async

Comparing ES7 and core.async

ES7 core.async
async function() {...} (fn [] (go ...))
await ... (<! ...)
await* or Promise.all(...) (doseq [c ...] (<! c))
@jmacias
jmacias / core.cljs
Last active August 29, 2015 14:24 — forked from ducky427/core.cljs
(ns datatable.core
(:require [reagent.core :as reagent]
[cljsjs.fixed-data-table]))
(def Table (reagent/adapt-react-class js/FixedDataTable.Table))
(def Column (reagent/adapt-react-class js/FixedDataTable.Column))
(defn gen-table
"Generate `size` rows vector of 4 columns vectors to mock up the table."
[size]
@jmacias
jmacias / upload.cljs
Last active August 29, 2015 14:20 — forked from anonymous/upload.cljs
(defn upload! [owner]
(let [form (om/get-node owner "upload-form")
io (goog.net.IframeIo.)]
(goog.events.listen
io goog.net.EventType.COMPLETE #(js/console.log "COMPLETE"))
(goog.events.listen
io goog.net.EventType.SUCCESS (fn [_]
(put!
(om/get-state owner :reset-file-drop)
true)
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]
@jmacias
jmacias / -README.md
Last active August 29, 2015 14:16 — forked from jirutka/-README.md

How to use terminal on Windows without going crazy…

Windows is really horrible system for developers and especially for devops. It doesn’t even have a usable terminal and shell, so working with command line is really pain in the ass. If you really don’t want to switch to any usable system (OS X, Linux, BSD…), then this guide should help you to setup somewhat reasonable environment – usable terminal, proper shell, ssh client, git and Sublime Text as a default editor for shell.

Install stuff

  1. Download and install Git for Windows* with:
    • [✘] Use Git from the Windows Command Prompt
  • [✘] Checkout as-is, commit Unix-style line endings
<html>
<head>
<style type="text/css">
.slider{
margin:50px auto;
width:500px;
height:300px;
overflow:hidden;
position:relative;
border:5px solid #eaeaea;

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

;; Datomic example code
(use '[datomic.api :only (db q) :as d])
;; ?answer binds a scalar
(q '[:find ?answer :in ?answer]
42)
;; of course you can bind more than one of anything
(q '[:find ?last ?first :in ?last ?first]
"Doe" "John")