Skip to content

Instantly share code, notes, and snippets.

View selfsame's full-sized avatar

Joseph Parker selfsame

View GitHub Profile
(ns sync.sheets
(:require-macros [reagent.ratom :refer [reaction]])
(:require
[om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[heh.core :as heh :refer [private private!] :refer-macros [html]]
[reagent.core :as r]
[goog.events :as events]
[css.units :as units]
(defmacro machine [sym args & body]
(let [gosym (symbol (str sym (hash sym)))
[state value] args
pre (take-while (comp not {'-> 1} first) body)
inputs (filter (comp {'-> 1} first) body)
chans (cons '_kill_ (map (comp first rest) inputs))
conds (map #(list '= 'c %) chans)
outputs (cons nil (map (comp first format rest rest) inputs))]
`(do
~@(map (fn [c] (concat ['def c] ['(chan (async/sliding-buffer 1))])) chans)
@selfsame
selfsame / style.md
Last active February 1, 2016 16:00

finalpage dev gist blog

@selfsame
selfsame / om.next_design_question.md
Last active December 7, 2017 21:09
om next design question

how should I structure my component/queries?

My application interface is a set of generic panels that can be configured to display components via a :view prop. The views correspond to components that have a top level query. There could be 0-n instances of a component.

The panels themselves are normalized in the app-state:

{:panels/by-id {
(ns fast.core
(:refer-clojure :exclude [-next])
(:require [css.units :as u]
[cljs.pprint :as pprint]))
(def -UID (atom 0))
(defn new-uid [] (swap! -UID inc))
(defonce m-u-m (js/Array.))
(aset js/window "mum" m-u-m)
@selfsame
selfsame / error
Last active February 17, 2016 19:53
2012 ~/.prosaic/templates prosaic poem new -t couplet
#!/usr/bin/env python # Reflects the requests from HTTP methods GET, POST, PUT, and DELETE # Written by Nathan Hamiel (2010) from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from optparse import OptionParser class RequestHandler(BaseHTTPRequestHandler)
#!/usr/bin/env python # Reflects the requests from HTTP methods GET, POST, PUT, and DELETE # Written by Nathan Hamiel (2010) from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from optparse import OptionParser class RequestHandler(BaseHTTPRequestHandler)
(ns fp.flow
(:require-macros [cljs.core.async.macros :refer [go]])
(:require
[om.core :as om :include-macros true]
[cljs.pprint :as pprint]
[pdfn.core :refer [and* or* not* is*] :refer-macros [defpdfn pdfn inspect]]
[fp.cache :as cache]
[fp.canvas :as c]
[css.units :as u]
[cljs.core.async :as async :refer [>! <! put! chan dropping-buffer]]
(ns commands.dom
(:require
[om.next :as om]
[commands.core :refer-macros [defcommand]]
[pdfn.core :refer [and* or* not* is*] :refer-macros [defpdfn pdfn inspect compile!]]
[fast.util] [fast.core :refer [-o -parent -next -prev -nodes]]
[fp.data][fp.selection][fp.util][fp.refs][fp.flow][sync.core]))
(defn walk-selection [k]
(let [So (filter -o (fp.refs/doc :selection/uids))
import ctypes
import urllib2
import time
import sys
if len(sys.argv) > 1:
source = sys.argv[1]
else:
source = "http://sdo.gsfc.nasa.gov/assets/img/latest/latest_1024_0304.jpg"
@selfsame
selfsame / dags.edn
Last active February 28, 2016 12:21
[:blender QmUcaPq17HkUk485tigEDW1QPvewCCeRFnyMH8yuR3ddtY
:gifs QmZiTtJA34EP7kYcNAyuju18KUndEbXk9hY7mRrxpBwgCx
]