Skip to content

Instantly share code, notes, and snippets.

View nacengineer's full-sized avatar

David Southard nacengineer

View GitHub Profile
@nacengineer
nacengineer / jrubyrc
Created February 6, 2013 15:18
simple rc file for jruby
compat.version=1.9
cext.enabled=true
errno.backtrace=true
Xcext.enabled=true
@nacengineer
nacengineer / nginx_init_file.sh
Created February 6, 2013 16:14
Basic Unicorn nginx init.d file
upstream mysite {
server unix:/etc/unicorn/sockets/mysite.socket fail_timeout=0;
}
server {
client_max_body_size 2M;
keepalive_timeout 5;
listen 80;
server_name localhost;
@nacengineer
nacengineer / Gemfile
Last active December 14, 2015 01:19 — forked from anonymous/Gemfile
MiniTest Baseline Config
group :development, :test do
gem 'sqlite3'
gem 'trinidad', :platform => :jruby
gem 'unicorn', :platform => :ruby
gem 'better_errors'
gem 'binding_of_caller'
gem 'awesome_print'
gem 'rake'
gem 'pry', :require => false
gem 'chef'
@nacengineer
nacengineer / deploy.rb
Created March 12, 2013 14:30
Capistrano tricks to add to your deploy.rb file.
require 'capistrano_colors'
require 'capistrano/maintenance'
require 'capistrano/ext/multistage'
require 'colored'
require 'ruby_cowsay'
require 'manic_monkey'
# change this to ::INFO if you need more... umm... info
# change this to ::IMPORTANT for normal deploys
logger.level = Logger::IMPORTANT
@nacengineer
nacengineer / _source.md
Last active December 18, 2015 01:49
Twitter Bootstrap DateTimePicker w Ruby on Rails & Simple Form & Haml
# elevate to root and save file
# http://unix.stackexchange.com/a/11006/31042
:w !sudo dd of=%
class DateTimePickerInput < SimpleForm::Inputs::Base
def input
template.content_tag(:div, class: 'input-group date form_datetime') do
template.concat @builder.text_field(attribute_name, input_html_options)
template.concat span_remove
template.concat span_table
end
end
private
$ irb
# sample array of slots
rbx-2.2.5 :001 > a = %w[slot1 slot3]
=> ["slot1", "slot3"]
# require our class, in this case called section
rbx-2.2.5 :002 > require './lib/section.rb'
=> true
@nacengineer
nacengineer / fix-vmware-headers.md
Last active August 29, 2015 13:57
Fix the Linux Headers for install of VMWare Sphere Virtual Tools

Ensure Headers are Installed

sudo apt-get update && sudo apt-get install build-essential linux-headers-$(uname -r)

Symlink Headers

sudo ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).