Skip to content

Instantly share code, notes, and snippets.

View clifton's full-sized avatar
🎯

Clifton King clifton

🎯
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<course_entries>
<course_entry>
<account_id>3287</account_id>
<name>Chemistry</name>
<date>2012-05-15</date>
<id>1</id>
<link>https://courses.yourschool.edu/chemistry</link>
</course_entry>
</course_entries>
<?xml version="1.0" encoding="UTF-8"?>
<course_entry>
<account_id>3287</account_id>
<name>Chemistry</name>
<date>2012-05-15</date>
<id>1</id>
<link>https://courses.yourschool.edu/chemistry</link>
</course_entry>
$(document).ready(function() {
// automatically fix obfuscated email addresses pasted into
// to/cc/bcc fields
$("textarea[name=to], textarea[name=cc], textarea[name=bcc]")
.live('blur', function(e){
var text = $(this).val();
var separators = ['_', ' ', '\\[', '\\]', '\\(', '\\)'];
var separatorExp = '(' + separators.join('|') + ')+';
#! /usr/bin/ruby
# Pre-commit hook for removing trailing whitespace, converting tabs to
# spaces and removing blank lines at the end of a file.
#
# Author: Clifton King <[email protected]>
# gist: https://gist.github.com/3173611
if File.exists? '.git/merge-rebase'
puts "Detected '.git/merge-rebase'! Skipping pre-commit hook..."

Fellow wizards of λ,

I'm a developer that's been doing Ruby for about 5 years at OrgSync, an awesome company that I helped bootstrap out of a house in Austin, TX while studying CS at UT. We have a really great subscription-based business model; directly serving over 300 colleges and universities (to include Stanford as well as USF & SFSU) at a 95+% annual renewal rate. We have also never taken any VC funding, which I believe is a stance in vogue right now (I'm only kind-of joking if any githubbers read this).

@clifton
clifton / index.txt
Created September 24, 2012 03:21 — forked from gus/index.txt
Ruby/Clojure analogs
For each Ruby module/class, we have Ruby methods on the left and the equivalent
Clojure functions and/or relevant notes are on the right.
For clojure functions, symbols indicate existing method definitions, in the
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master,
ruby-to-clojure.*/* functions can be obtained from the source files in this
gist.
If no method symbol is given, we use the following notation:
(ns datomic-helpers
(:require [clojure.java.io :as io]
[clojure.walk :as walk]
[datomic.api :as d :refer (db)]))
;;; Expose Datomic vars here, for convenience
(def tempid d/tempid)
(def connect d/connect)
(def create-database d/create-database)
#!/bin/bash
set -o errexit
set -o nounset
if [[ ${#} -ne 1 ]]
then
echo "Usage: ${0} upstart-conf-file" >&2
exit 1
fi
(use '[datomic.api :only [db q] :as d])
;;LOOK IN THE BOTTOM FOR CORRECT USE OF DATOMIC :)
;;not supplied:
;;* connecting to a db named "conn"
;; (checkout awesome Jonas Edlunds gist
;; for inspiration: https://gist.github.com/3122363 )
;;* a schema that fit's the following person-datoms
(use '[datomic.api :only [q db] :as d])
(def uri "datomic:mem://accounts")
;; create database
(d/create-database uri)
;; connect to database
(def conn (d/connect uri))