Skip to content

Instantly share code, notes, and snippets.

@jraines
jraines / rails31init.md
Created May 24, 2011 17:03
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@jraines
jraines / docsplit.md
Created June 9, 2011 22:08
Docsplit notes

Dependencies

  • GraphicsMagick
  • poppler-utils
  • open office -- will this work with Open Office on server?
gem 'docsplit'

Extraction

Q: Can we make this a gated community?

A: No. It would require buying the streets, which would be very expensive and as far as we know the city is not even selling, as the general plan of the city discourages new gated communities.

Q: Do I have to submit a plan for backyard landscaping?

A: Yes, to the HOA.

Q: Why are we considering license plate reader cameras?

@jraines
jraines / gist:476dae7017632df4a4b1
Created October 20, 2015 17:35
Minimal AWS Lambda Alexa js
/**
* This sample demonstrates a simple skill built with the Amazon Alexa Skills Kit.
* For additional samples, visit the Alexa Skills Kit developer documentation at
* https://developer.amazon.com/appsandservices/solutions/alexa/alexa-skills-kit/getting-started-guide
*/
// Route the incoming request based on type (LaunchRequest, IntentRequest,
// etc.) The JSON body of the request is provided in the event parameter.
exports.handler = function (event, context) {
try {
@jraines
jraines / confident-code.md
Created May 17, 2011 19:05
Notes on Avdi Grimm's "Confident Code"

Confident Code

timid code

  • Randomly mixes input gathering, error handling, and business logic
  • imposes cognitive load on the reader

confident code

  • no digressions
@jraines
jraines / spacemacs.el
Created November 11, 2015 19:48
spacemacs config so far
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
(setq-default neo-vc-integration nil)
(spacemacs/toggle-maximize-frame)
(setq projectile-enable-caching t)
@jraines
jraines / MacVim-Janus.md
Created May 1, 2011 20:03
Macvim & Janus

##Intro

Janus is a "basic distribution of vim plugins and tools intended to be run on top of the latest MacVIM snapshot." It is maintained by Yehuda Katz and Carl Lerche.

I recently whinged on Twitter that all I really want is vim with TextMate's Command-T go-to-file functionality and some efficient visual tab/buffer navigation. Turns out MacVim + Janus, with just a few tweaks, is all that and more.

Installing Janus

Follow the installation instructions on the git page

@jraines
jraines / electors.clj
Last active December 2, 2016 04:15
electors.clj
(ns electoral.core
(:require [csv-map.core :as csv])
(:gen-class))
(defn get-votes [e state-name]
(:votes (first (filter #(= state-name (:state %)) e))))
(def data
@jraines
jraines / quiz.cljs
Created August 4, 2015 19:50
Attempt to do a kinda sorta redux like app in ClojureScript
(ns ^:figwheel-always ramquiz.core
(:require [quiescent.core :as q]
[quiescent.dom :as d]))
(enable-console-print!)
(declare render-app)
;; the data
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sierpinski triangle</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<script type="text/javascript">
//Width and height