Skip to content

Instantly share code, notes, and snippets.

View nacengineer's full-sized avatar

David Southard nacengineer

  • UW Madison, General Library System
  • Madison, WI
  • 10:02 (UTC -05:00)
View GitHub Profile
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
# elevate to root and save file
# http://unix.stackexchange.com/a/11006/31042
:w !sudo dd of=%
@nacengineer
nacengineer / _source.md
Last active December 18, 2015 01:49
Twitter Bootstrap DateTimePicker w Ruby on Rails & Simple Form & Haml
@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 / 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 / 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 / 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 / meow.scss
Created January 23, 2013 03:03
An SCSS version of Zac Stewart's Meow CSS
.meows {
position: fixed;
top: 0;
right: 0;
}
.meow {
margin: 20px 20px 0 0;
position: relative;
@nacengineer
nacengineer / sublime_text_2_user_settings.json
Created January 22, 2013 21:33
my sublime text user settings
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
@nacengineer
nacengineer / unicorn_control.sh
Created January 18, 2013 02:23
Unicorn Control Script with some Princess Bride Sprinkled in.
#!/usr/bin/env bash
# Modified for Rails 3 by Dave Southard January 17th, 2012
# Now with more princess bride!
RAILS_ENV=production
APP_ROOT=/var/rails/unicorn/$1
CURRENT_APP=$APP_ROOT/current
PID=/etc/unicorn/pids/$1.pid
OLD_PID=$PID.oldbin
START_COMMAND="bundle exec unicorn -D -E $RAILS_ENV -c /etc/unicorn/conf/$1.conf"