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
@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
/**
* 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 / .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
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
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);
},
;; 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
(ns user)
(def app
"Intenal Helper"
(fnil conj []))
(defprotocol PathSeq
(path-seq* [form path] "Helper for path-seq"))
(extend-protocol PathSeq
#!/bin/sh
git rev-parse 2>/dev/null
if [[ $? != 0 ]]
then
echo "Not a git repo"
return
fi
@DarrenN
DarrenN / pr.md
Last active August 29, 2015 14:18 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: