Skip to content

Instantly share code, notes, and snippets.

View jcf's full-sized avatar
❤️

James Conroy-Finn jcf

❤️
View GitHub Profile
@mislav
mislav / .rspactor
Created March 17, 2009 13:12
RSpec colorized unicode output with Rspactor integration
# this goes in the $HOME dir
# needs mislav-rspactor v0.3.2 and RSpec 1.2
RSpactor::Runner.class_eval do
alias old_formatter_opts formatter_opts
def formatter_opts
# update this path to where you saved unicode_formatter.rb
old_formatter_opts + " -r /Users/mislav/Projects/unicode_formatter -f UnicodeFormatter"
end
end
@jcf
jcf / rvm-iconv.rb
Created January 11, 2010 15:42
The full ruby 1.9.1 iconv fix
RUBY_VERSION='1.9.2'
rvm package install iconv
rvm remove $RUBY_VERSION
rvm install $RUBY_VERSION -C --with-iconv-dir=$HOME/.rvm/usr
~$ ARCHFLAGS='-arch i386 -arch x86_64'
~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download
~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0
~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes
~/RubyCocoa-1.0.0$ ruby install.rb setup
~/RubyCocoa-1.0.0$ sudo ruby install.rb install
@jcf
jcf / development.rb
Created July 28, 2010 11:42
Keep your javascripts in app/javascripts. Read and serve in development and package before deployment
# In config/environments/development.rb
config.middleware.use 'DevelopmentJavascript'
@jcf
jcf / last-rails-migration.sh
Created October 8, 2010 08:28
Get the version of the last staged migration in db/migrate
git ls-files --stage -- db/migrate | xargs -I x basename x | awk ' END { split($1, a, "_"); print a[1] } '
@jcf
jcf / bootstrap.sh
Created April 3, 2012 16:17
Bootstrap a Ruby app that uses Bundler
#!/bin/bash
echo "Checking for Ruby..."
type -P ruby &>/dev/null || { echo >&2 "Ruby not found in PATH. Exiting."; exit 1; }
echo "Checking for Bundler..."
gem which bundler &>/dev/null || gem install bundler
echo "Installing gem dependencies..."
bundle install
@joshuap
joshuap / deploy.rb
Created October 7, 2012 01:19
Honeybadger deployment notification capistrano task using local machine and curl
namespace :deploy do
desc "Notifies Honeybadger locally using curl"
task :notify_honeybadger do
require 'json'
require 'honeybadger'
begin
require './config/initializers/honeybadger'
rescue LoadError
logger.info 'Honeybadger initializer not found'
@mohamed-el-habib
mohamed-el-habib / gist:00deef599e8ba1cdbece
Last active September 6, 2016 10:11 — forked from abs/gist:c0d598996870dda719b3
Downloads and installs the startssl CA certs into the global Java keystore
#!/bin/bash
# Downloads and installs the startssl CA certs into the global Java keystore
# https://sipb.mit.edu/doc/safe-shell/
set -euf -o pipefail
# Check if JAVA_HOME is set
if [ "$JAVA_HOME" = "" ]
then
echo "ERROR: JAVA_HOME must be set."
exit 1
@taylorSando
taylorSando / clj-material-ui
Last active November 18, 2016 11:06
How to use material ui with om
(ns om-material-ui.core
(:require [clojure.string :as str]
[om-tools.dom :as omt]))
(defn kebab-case
"Converts CamelCase / camelCase to kebab-case"
[s]
(str/join "-" (map str/lower-case (re-seq #"\w[a-z]+" s))))
(def material-tags
@rauhs
rauhs / om.next+pedestal+transit.clj
Last active December 10, 2017 17:08
Om.next tempid handling for pedestal. Interceptors.
(ns srs-s.routes.core
(:require [io.pedestal.http :as pedestal]
[io.pedestal.http.route.definition :refer [defroutes]]
[io.pedestal.interceptor.helpers :as interceptor]
[io.pedestal.http.body-params :as body-params]
[ring.util.response :as ring-response]
[cognitect.transit :as transit]
[om.next.server :as om]
[om.tempid :as tempid])
(:import [java.io OutputStream]