Skip to content

Instantly share code, notes, and snippets.

View dgellow's full-sized avatar
🐢
Pulu pulu 🏳️‍🌈

Sam El-Borai dgellow

🐢
Pulu pulu 🏳️‍🌈
View GitHub Profile
@john2x
john2x / 00_destructuring.md
Last active May 29, 2024 00:25
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

@staltz
staltz / introrx.md
Last active June 2, 2024 11:03
The introduction to Reactive Programming you've been missing
@viperscape
viperscape / broadcast-stream.clj
Last active August 29, 2015 14:01
many-to-many broadcast stream
(defn v-> [s v]
"pushes value onto stack, if possible, returns new head/tail"
(let [p (promise)]
(if (deliver s (cons v (list p)))
p)))
(defn v<- [s]
"returns lazy sequence of actual values, without head/tail"
(when (realized? s)
(cons (first @s)
@zbyte64
zbyte64 / guideline.rst
Last active September 15, 2016 09:32
React.js Component Guideline

React.js Minimal Entropy Guide

DO's:

  • Use explicit contracts to pipe data & events between systems
  • Business rules should bubble towards the top, UI and semantics should sink towards the bottom

DONT's:

; ___ _ __ ___ __ ___
; / __|_ _ __ _| |_____ / /| __|/ \_ )
; \__ \ ' \/ _` | / / -_) _ \__ \ () / /
; |___/_||_\__,_|_\_\___\___/___/\__/___|
; An annotated version of the snake example from Nick Morgan's 6502 assembly tutorial
; on http://skilldrick.github.io/easy6502/ that I created as an exercise for myself
; to learn a little bit about assembly. I **think** I understood everything, but I may
; also be completely wrong :-)
@insin
insin / contactform.js
Last active January 9, 2024 05:27
React contact form example
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({
@kemitchell
kemitchell / install-couchdb.sh
Last active January 3, 2016 01:59
Install CouchDB 1.5.0 on Erlang R16B03 on Debian 7.3 as of 2014-01-12
#!/bin/sh
# Install Erlang R16B03 and CouchDB 1.5.0 on Debian 7.3 as of 2014-01-12
# Download current stable versions
wget -c http://apache.cs.utah.edu/couchdb/source/1.5.0/apache-couchdb-1.5.0.tar.gz
wget -c http://www.erlang.org/download/otp_src_R16B03.tar.gz
# Extract source archives
tar xvf apache-couchdb-1.5.0.tar.gz
from fabric.api import *
import vagrant
def with_vagrant(vm_name=None):
"""Apply the rule with the vagrant box."""
print("applying on box {}".format(vm_name))
v = vagrant.Vagrant()
if not all([status == "running" for status in v.status().values()]):
print("Vagrant is not running, starting it right now.")
v.up()
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@pangloss
pangloss / xn.test.cljs
Last active January 23, 2020 05:45
ClojureScript XHR with core.async.
(ns xn.test
(:require-macros [cljs.core.async.macros :refer [go alts!]]
(:require [xn.core :as xn]
[xn.util :as u]
[cljs.core.async :refer [<! take!]]
[xn.xhr :refer [request-body request-records chain-req]]))
(def sample-app
(reify
xn/Application