Skip to content

Instantly share code, notes, and snippets.

View hkjels's full-sized avatar

Henrik Kjerringvåg hkjels

View GitHub Profile
@jackrusher
jackrusher / gist:5139396
Last active November 13, 2024 21:08
Hofstadter on Lisp: Atoms and Lists, re-printed in Metamagical Themas.

Hofstadter on Lisp

In the mid-80s, while reading through my roommate's collection of Scientific American back issues, I encountered this introduction to Lisp written by Douglas Hofstadter. I found it very charming at the time, and provide it here (somewhat illegally) for the edification of a new generation of Lispers.

In a testament to the timelessness of Lisp, you can still run all the examples below in emacs if you install these aliases:

(defalias 'plus #'+)
(defalias 'quotient #'/)
(defalias 'times #'*)
(defalias 'difference #'-)
@hkjels
hkjels / cd.vim
Created May 28, 2013 22:26
Override native `cd`-command, so that the `z` index is updated with whatever directories you `cd` into.
fun! s:CD(directory)
exec '!cd '.directory
exec 'cd '.directory
endfun
cabbrev cd <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'CD' : 'cd')<CR>
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@jbenet
jbenet / simple-git-branching-model.md
Last active November 9, 2024 04:55
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.

@mbostock
mbostock / .block
Last active February 9, 2016 01:58
Radial Gradient
license: gpl-3.0
@staltz
staltz / introrx.md
Last active November 14, 2024 11:27
The introduction to Reactive Programming you've been missing
@pandeiro
pandeiro / README.md
Last active June 2, 2020 08:02
Example of a simple webapp written as a single file

Instructions

  1. Get Boot
  2. Copy the above file to $HOME/app.boot
  3. $ chmod a+x $HOME/app.boot
  4. $ cd &amp;&amp; ./app.boot

Writing Generic Components

The React community has gone through several patterns for how to compose React components, but it generally has settled on a few techniques. Which one you use depends on the type of component you are building.

Using props.children

The simplest way to make a component more generic is to allow

clojure.spec

Available in Clojure 1.9 (now in alpha)

(defproject robochef "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.9.0-alpha5"]])

In the namespace clojure.spec