Skip to content

Instantly share code, notes, and snippets.

View ghostandthemachine's full-sized avatar

Jon Rose ghostandthemachine

  • Origin Rose
  • Boulder, Colorado
View GitHub Profile
## I want to add a column in the event table that will store the google calendar event id. So far I found the event.rb and I added the correct column.
## i'm assuming something like this
## event.rb
class Event
property :google_calendar_event_id, String
end
## What I need to figure out is how to query the event table for a given event id and then once I return a valid event, I need to be able to add the google calendar event id.
(ns sherpa.client.quad-tree
(:refer-clojure :exclude [node children])
(:use [sherpa.client.util :only [log uuid]]))
; ;========================================================================================
; ; Node
; ;========================================================================================
(def TOP_LEFT 0)
(ns ai.core
(:require [clojure.core.async :as async :refer [<! >! <!! timeout chan alt! go]]))
;; Helper functions
(defn log
"Log function. Takes base and a value."
[b v]
(/ (Math/log v)

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

Keybase proof

I hereby claim:

  • I am ghostandthemachine on github.
  • I am jonrose (https://keybase.io/jonrose) on keybase.
  • I have a public key whose fingerprint is B473 C5C4 D353 D018 D4FA 76E1 A82A 9D0C 8D31 BEBF

To claim this, I am signing this object:

#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
; Ruby has an awesome feature -- string interpolation. Read about it on the internet.
; On the other hand, Clojure only has cumbersome Java string formatting, which can not be
; used without pain after you've tried Ruby.
; So here's this simple macro that basically allows you to do most things you could do
; with Ruby string interpolation in Clojure.
(ns eis.stuff
(:require [clojure.string]))
@ghostandthemachine
ghostandthemachine / easing.js
Last active August 29, 2015 14:08 — forked from gre/easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity

Clojure on Raspberry Pi with OS X

"Clojure running on Raspberry Pi" sounded so cool that I just had to give it a try.

Install JDK

  • Download ARM JDK from Oracle and instlal on Raspberry Pi
  • Change visudo to contain the following
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);