Skip to content

Instantly share code, notes, and snippets.

@latortuga
latortuga / ftags.sh
Created November 3, 2011 17:32
tag generator
#! /usr/bin/env bash
FILE_TAGS_NAME='ftags'
echo '!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/' > $FILE_TAGS_NAME
echo '!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/' >> $FILE_TAGS_NAME
echo '!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/' >> $FILE_TAGS_NAME
echo '!_TAG_PROGRAM_NAME Exuberant Ctags //' >> $FILE_TAGS_NAME
echo '!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/' >> $FILE_TAGS_NAME
echo '!_TAG_PROGRAM_VERSION 5.7 //' >> $FILE_TAGS_NAME
has_many :child_connections, :class_name => 'Connection', :foreign_key => 'from_id'
has_many :parent_connections, :class_name => 'Connection', :foreign_key => 'to_id', :dependent => :destroy
has_many :children, :through => :child_connections, :source => :to
has_many :parents, :through => :parent_connections, :source => :from
MyApp::Application.configure do
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.action_dispatch.x_sendfile_header = "X-Sendfile"
config.cache_store = :dalli_store
@latortuga
latortuga / application.rb
Created March 28, 2012 19:41
Canonical Host Rails Middleware
# config/application.rb
module YourApplication
class Application < Rails::Application
config.autoload_paths += %W(#{config.root}/lib)
end
end
@latortuga
latortuga / example.js
Created April 20, 2012 19:43
Attach a click handler to gallery images
$(document).ready(function() {
// page is ready, do things here
})
$(document).on('click','#gallery img',function() {
// click handler here
})
@latortuga
latortuga / application.css.scss
Created May 11, 2012 17:08
gallery hover effects
d;
}
.gallery-slideshow-caption {
width:300px;
height:298px;
float: right;
left:880px;
color:#fff;
background: $red;
@latortuga
latortuga / error.json
Created June 26, 2012 15:11
nova error
{"status":"error","errors":{"error":"Application error\n#0 \/usr\/local\/zend\/share\/ZendFramework\/library\/Zend\/View\/Abstract.php(884): Zend_View_Abstract->_script('response.phtml')\n#1 \/usr\/local\/zend\/share\/ZendFramework\/library\/Zend\/Controller\/Action\/Helper\/ViewRenderer.php(900): Zend_View_Abstract->render('response.phtml')\n#2 \/usr\/local\/zend\/share\/ZendFramework\/library\/Zend\/Controller\/Action\/Helper\/ViewRenderer.php(921): Zend_Controller_Action_Helper_ViewRenderer->renderScript('response.phtml', NULL)\n#3 \/usr\/local\/zend\/share\/ZendFramework\/library\/Zend\/Controller\/Action\/Helper\/ViewRenderer.php(960): Zend_Controller_Action_Helper_ViewRenderer->render()\n#4 \/usr\/local\/zend\/share\/ZendFramework\/library\/Zend\/Controller\/Action\/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()\n#5 \/usr\/local\/zend\/share\/ZendFramework\/library\/Zend\/Controller\/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()\n#6 \/usr\/
@latortuga
latortuga / nova.rb
Created June 26, 2012 15:42
nova watermark post
{:input=>:s3, :"input_params[aws_access_key]"=>"AKIAINB7DG747Z3YIZLA", :"input_params[aws_secret_key]"=>"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", :"input_params[aws_bucket]"=>"pb_test_uploads/finaltesting", :"input_params[aws_path]"=>"final/28_chairman_meow/4_full_chairman_meow.wav", :output=>:s3, :"output_params[aws_access_key]"=>"AKIAINB7DG747Z3YIZLA", :"output_params[aws_secret_key]"=>"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", :"output_params[aws_bucket]"=>"pb_test_uploads/finaltesting", :"output_params[aws_path]"=>"preview/28_chairman_meow/4_full_chairman_meow.mp3", :callback_url=>"http://3j2f.localtunnel.com/callbacks/28/137/processing_complete", :format=>:json, :processing=>:async, :preview_id=>1, :output_format=>:mp3, :target_bitrate=>44100, :volume_min_threshold=>0.025, :reduction_factor=>2.61, :vo_short=>false}
@latortuga
latortuga / nested.rb
Created July 5, 2012 22:21
Nested forms for children and relationships
# Models
class Child
has_many :relationships
end
class RelationType
has_many :relationships
end
@latortuga
latortuga / .tmux.conf
Created September 14, 2012 14:51
tmux conf
# use bash
set-option -g default-shell /bin/bash
# set 256 colors!
set -g default-terminal "screen-256color"
# change default command sequence
unbind C-b
set-option -g prefix C-a