Skip to content

Instantly share code, notes, and snippets.

View mcmoyer's full-sized avatar

Marlon Moyer mcmoyer

View GitHub Profile
server {
listen 80;
server_name cms.my.site.com;
root /srv/www/mysite/current/public;
passenger_enabled on;
rails_env production;
client_max_body_size 50m;
}
server {
listen 80;
# start this task as deployer
description "Starts the rails app server(unicorn) as the user 'deployer'"
start on filesystem
chdir /srv/www/{path_to_my_app}
exec sudo -u deployer -i 'rvm ree; unicorn_rails -c /srv/www/{path_to_my_app}/config/unicorn.rb -E production'
@mcmoyer
mcmoyer / check_case.rb
Created November 11, 2010 04:01
use inside web site to find references to files that aren't correctly cased.
#!/usr/bin/ruby
files = Dir['**/**'].sort
files.each do |file|
#do a case insensitve search first
all_matches = `ack -lic "#{file}"`.split("\n")
puts "found #{all_matches.length} matches for #{file}"
exact_matches = `ack -lc "#{file}"`.split("\n")
difference = all_matches - exact_matches
@mcmoyer
mcmoyer / trace.log
Created May 19, 2011 19:36
JRuby bundler error
Updating git://github.com/alindeman/no_peeping_toms.git
zsh:1: no matches found: test/*
zsh:1: no matches found: bin/*
Updating git://github.com/mcmoyer/to_spreadsheet.git
Fetching source index for http://rubygems.org/
Fetching source index for http://gems.acig.com/
Using rake (0.8.7) from /home/mmoyer/.rvm/gems/jruby-1.6.1@global/specifications/rake-0.8.7.gemspec
Using aaronh-chronic (0.3.9) from /home/mmoyer/.rvm/gems/jruby-1.6.1@ccip3/specifications/aaronh-chronic-0.3.9.gemspec
Using abstract (1.0.0) from /home/mmoyer/.rvm/gems/jruby-1.6.1@ccip3/specifications/abstract-1.0.0.gemspec
Using activesupport (3.0.7) from /home/mmoyer/.rvm/gems/jruby-1.6.1@ccip3/specifications/activesupport-3.0.7.gemspec
@mcmoyer
mcmoyer / application_helper.rb
Last active December 11, 2015 23:48
my general coffeescript/javascript style
#embed this in your body tag
# %body{body_data}
def body_data
{
:"data-controller" => params[:controller],
:"data-action" => params[:action],
:"data-id" => params[:id],
:"data-parent-controller" => parent_controller,
:"data-parent-id" => params["#{parent_controller.to_s.singularize}_id".to_sym]
@mcmoyer
mcmoyer / generateThumbs.rb
Last active December 14, 2015 04:28
Thumbnail videos that don't have imdb info in mythTV. This takes into consideration storage groups in the mythTV system.
require 'sequel'
CONFIG = {
db_host_name: 'localhost',
db_user_name: 'mythtv',
db_name: 'mythconverg',
db_password: '*********',
out_path: "/tmp",
cover_path: "/var/lib/mythtv/coverart/",
frame: '0000000002.jpg',