Inspired by "Parsing CSS with Parsec".
Just quick notes and code that you can play with in REPL.
By @kachayev
<?php | |
/* | |
* Example code showing how to hook WordPress to add fields to the taxonomny term edit screen. | |
* | |
* This example is meant to show how, not to be a drop in example. | |
* | |
* This example was written in response to this question: | |
* | |
* http://lists.automattic.com/pipermail/wp-hackers/2010-August/033671.html | |
* |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
(defn scaffold [iface] | |
(doseq [[iface methods] (->> iface .getMethods | |
(map #(vector (.getName (.getDeclaringClass %)) | |
(symbol (.getName %)) | |
(count (.getParameterTypes %)))) | |
(group-by first))] | |
(println (str " " iface)) | |
(doseq [[_ name argcount] methods] | |
(println | |
(str " " |
# lightweight processing-esque canvas wrapper | |
class Sketch | |
constructor: (width, height) -> | |
@running = false | |
@canvas = (document.getElementsByTagName 'canvas')[0] | |
if @canvas | |
@canvas.parentNode.removeChild @canvas | |
@canvas = document.createElement 'canvas' | |
@canvas.width = width | |
@canvas.height = height |
;;; skewer-coffee.el --- skewer support for live-interactive Coffeescript | |
(defun skewer-coffee-eval (coffee-code) | |
"Requests the browser to evaluate a coffeescipt string." | |
;; XXX should escape double quote characters | |
(skewer-eval (concat "CoffeeScript.eval(\"" | |
(s-replace "\n" "\\n" (s-trim coffee-code)) | |
"\");") | |
#'skewer-post-minibuffer)) |
(ns n01se.externs-for-cljs | |
(:require [clojure.java.io :as io] | |
[cljs.compiler :as comp] | |
[cljs.analyzer :as ana])) | |
(defn read-file [file] | |
(let [eof (Object.)] | |
(with-open [stream (clojure.lang.LineNumberingPushbackReader. (io/reader file))] | |
(vec (take-while #(not= % eof) | |
(repeatedly #(read stream false eof))))))) |
(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))) |
Inspired by "Parsing CSS with Parsec".
Just quick notes and code that you can play with in REPL.
By @kachayev
React = require("react") | |
VideoPlayerComponent = require("components/VideoPlayerComponent") | |
AppComponent = React.createClass | |
# Need to add this manually if you want it to show up in React Chrome Dev Tools | |
# See https://github.com/jsdf/coffee-react-transform/issues/16 | |
displayName: "AppComponent" | |
render: -> | |
<div> |