Skip to content

Instantly share code, notes, and snippets.

@bigfatgreg
bigfatgreg / setup.sh
Last active December 19, 2015 18:08 — forked from krisf/setup.sh
#!/bin/bash
# install dependencies
apt-get update && apt-get upgrade
apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
# install RVM
\curl -L https://get.rvm.io | bash
# install ruby 2.0.0
# app / controllers / application_controller.rb
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
@bigfatgreg
bigfatgreg / xw.rb
Last active September 6, 2020 04:56 — forked from eliotfowler/xw.rb
.puz to xpf-json converter
#!/usr/bin/env ruby
require 'json'
@filename = ARGV[0]
def read_puz(length, offset)
return IO.read(@filename, length, offset)
end