Skip to content

Instantly share code, notes, and snippets.

View DarrenN's full-sized avatar
🌵
(on-a vision-quest)

Darren DarrenN

🌵
(on-a vision-quest)
View GitHub Profile
;; Updated tutorial code for Om 0.1.6, 2014-01-16
;; http://www.lexicallyscoped.com/2013/12/25/slice-of-reactjs-and-cljs.html
;; See comments below for details on the changes.
(def app-state
(atom {:comments [{:author "Pete Hunt" :text "This is a comment."}
{:author "Jordan Walke" :text "This is *another* coment"}]}))
(defn comment [{:keys [author text]} owner]
(om/component
define([
], function() {
return {
componentDidMount: function() {
this._boundForceUpdate = this.forceUpdate.bind(this, null);
this.getBackboneObject().on("all", this._boundForceUpdate, this);
},
componentWillUnmount: function() {
this.getBackboneObject().off("all", this._boundForceUpdate);
},
ADD NEW SUBMODULE
==============
$ git submodule add http://github.com/scrooloose/nerdtree.git vim/bundle/nerdtree
$ git submodule init
$ git commit -m 'add nerd tree plugin as submodule'
UPDATING
======
Git submodules are locked to specific commits in their respective
@DarrenN
DarrenN / .gitignore
Last active December 22, 2022 14:41 — forked from avescodes/Editing Clojure with Emacs
Emacs setup for Clojure
shibuya.el
dazza.el
elpa/
places
eshell/
.smex-items
ac-comphist.dat
projectile-bookmarks.eld
/**
* Creates an ArrayBuffer, converts the binary to a Uint8 Array, and
* places the buffer in a DataView, which is needed to create a Blob
**/
_makeBlob: function(binary) {
var data = new ArrayBuffer(binary.length),
mimeString = "text/plain",
ui8a = new Uint8Array(data, 0),
dataView,
blob;
@DarrenN
DarrenN / quicksilver_score.php
Created July 16, 2012 20:13 — forked from xeoncross/quicksilver_score.php
Quicksilver string ranking algorithm in PHP
<?
// Quicksilver Score
//
// A port of the Quicksilver string ranking algorithm
// (re-ported from Javascript to PHP by Kenzie Campbell)
// http://route19.com/logbook/view/quicksilver-score-in-php
//
// score("hello world","axl") //=> 0.0
// score("hello world","ow") //=> 0.6