Skip to content

Instantly share code, notes, and snippets.

View linuxsable's full-sized avatar

Tyler Van Hoomissen linuxsable

View GitHub Profile
export PROMPT_COMMAND=’if [ “$(id -u)” -ne 0 ]; then echo “`date` `pwd` `history 1`” » ~/.bash_log; fi’
// Setup backbone to handle auth tokens
// in all it's requests by override the sync method.
_setupAuthToken: function() {
var _sync = Backbone.sync;
Backbone.sync = function(method, model, options) {
options = options || {};
options.beforeSend = function(xhr, options) {
var _data = options.data;
var newData = _.extend(JSON.parse(options.data), {
auth_token: IS.currentUser.get('authToken'),
@linuxsable
linuxsable / gist:5171159
Created March 15, 2013 16:31
Calculates the closest to square two factors of any number.
(defn divides?
"Does divisor divide dividend evenly?"
[dividend divisor]
(zero? (rem dividend divisor)))
(defn factors
"Returns a sequence of all factors of p."
[p]
(filter #(divides? p %) (range 2 p)))
(defparameter *nodes* '((living-room (you are in the living-room. a wizard is snoring loudly on the couch.))
(garden (you are in a beautiful garden. there is a well in front of you.))
(attic (you are in the attic. there is a giant welding torch in the corner.))))
(defun describe-location (location nodes)
(cadr (assoc location nodes)))
(defparameter *edges* '((living-room (garden west door) (attic upstairs ladder))
(garden (living-room east door))
(attic (living-room downstairs ladder))))
(defun my-length (list)
(if list
(1+ (my-length (cdr list)))
0))
(assert (eq (my-length '(1 2 3)) 3))
(assert (eq (my-length (list 234)) 1))
(defvar *number-was-odd* nil)
function () {
var a = "all";
R.logger = {
_originalLog: _.isUndefined(window.console) ? R.doNothing : console.log,
_originalError: _.isUndefined(window.console) ? R.doNothing : console.error,
logQueue: [],
_log: function (a, b, c) {
a[0] = "[" + Date() + "] " + a[0], this.logQueue.unshift(a.join(" ")), this.logQueue.length >= 10 && this.logQueue.pop();
if (!c) return;
try {
window.App.Engine =
matrix: []
moveHistory: []
initialized: false
BLACK_STONE: 1
WHITE_STONE: 2
init: ->
if @initialized
export PROMPT_COMMAND=’if [ “$(id -u)” -ne 0 ]; then echo “`date` `pwd` `history 1`” » ~/.bash_log; fi’
Mobile.NavMain.init({
pageId: function() {
if (initType == TYPES.GROUPS) {
return Mobile.NavMain.PAGE_IDS.FEED;
} else {
return Mobile.NavMain.PAGE_IDS.PROFILE_FEED;
}
}(),
groupName: initGroupName,
userId: initUserId
if*L2KDY4Q[LYPfL*L|. c- !PbNZZGYQ*[4XLPY)zDzNX5DYZj4QGmWDQMMA8MKWWK8WWKKW88KA4XN!-. -.--.,,,,..~ceY[tjjLT2)/zT(TT77[g7Y(+g2g/jjfY)TVj][2++[j2(Z
/2D+LYd*Dt[LZdG[QVT]\ Yv2KGKmmG*454/NN*bQXgPNYbGYmQfXYX8KKAKKMAKKAWAM8WM88MKAMQdL,, .(YjTTTg7[Y, -.-- ,,-.,-,--. -..,,,-,--_
[Ymdd*YNGNVV]VZGQ5]m[. KPY45PPY*ZdZPD44Zb*]b*D(5PKQGGMMWMMWKMAKMb45KWWKWMMMMAdZ4D[-. .7XPYQ*PX5]
/\mKXZXQZbP42+G*KTj[+v~L, /=Db*GdQ55*KMG*GmXDN4YV(/fVYQtQMWd5dKX5mQZGjDf/)eNKDPbNXPKj+!~.-- ,[ZLPmdb4N]
[LQDYdKmYmmQGQKP4N[j)P[[c..fzQQPWZ*AGd4dmX4*ND(Yz__fbPXZ5GPYDZ5m7Vv!_vc\~\_c\\~Tgt(z]Lv, ~-, ,]P2td5dtt!
bbXKYdXzKm+d44YQQd+Z*zg=]|tDPPDb5DMM4d*Kd5XmbQ*GVj2mGY*bbb*557tv__~~\vv|/i\!__i/=/+Yf7!- - - ,Yt7YzD*fV!
bD*XGmKL54Km4Q4bb2ed5KmYjV7PD*QdP5GK*P*Dm4m445N*2YDbPYQKGN