This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this in in config/initializers | |
require 'nested_form/builder_mixin' | |
module NestedForm | |
module BuilderMixin | |
alias_method :link_to_add_original, :link_to_add | |
alias_method :link_to_remove_original, :link_to_remove | |
def link_to_add(*args, &block) | |
options = args.extract_options!.symbolize_keys | |
options[:class] = [options[:class], 'btn'].compact.join(' ') | |
link_to_add_original *args, options, &block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExampleModel < ActiveRecord::Base | |
# include the module | |
include Extensions::Permalink | |
# make sure there's a method named "unicode" that | |
# returns the string you'd like to sluggify | |
def unicode | |
self.name | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nested_form/builder_mixin' | |
module NestedForm | |
module BuilderMixin | |
alias_method :link_to_add_original, :link_to_add | |
alias_method :link_to_remove_original, :link_to_remove | |
def link_to_add(*args, &block) | |
options = args.extract_options!.symbolize_keys | |
options[:class] = [options[:class], 'btn btn-inverse'].compact.join(' ') unless options[:plain] | |
link_to_add_original *args, options, &block | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :standalone_port, 3000 | |
namespace :deploy do | |
task :start do | |
run "cd #{latest_release} && RAILS_ENV=#{rails_env} passenger start -p #{standalone_port} -d" | |
end | |
task :stop do | |
run "cd #{latest_release} && RAILS_ENV=#{rails_env} passenger stop" | |
end | |
task :restart, :roles => :app, :except => { :no_release => true } do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// full path to project root (you'll need to edit this) | |
$root = dirname(dirname(dirname(__DIR__))); | |
// project name here (full db name will be my_project_[current git branch]) | |
$project_name = 'my_project'; | |
// base connection info | |
$base_conn = array( | |
'driver' => 'mysql', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var PrettyLoader = function(el, opts) { | |
var settings = $.extend({}, $.fn.prettyloader.defaults, opts) | |
$el = $(el); | |
function init() { | |
$el.hide().one('load', loaded).each(function() { | |
// manually call load() if the image has been cached | |
if (this.complete) $el.load(); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cd to the git root | |
cd.() { | |
cd $(git rev-parse --show-toplevel) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SelectOrOther plugin | |
* | |
* works with our custom simple_form select_or_other input | |
*/ | |
(function($) { | |
var SelectOrOther = function(el, opts) { | |
var settings = $.extend({}, $.fn.selectorother.defaults, opts), $el, | |
$select, $other; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
killport() { | |
if [ -n "${1}" ]; then | |
port=$1 | |
else | |
# default (Rails-centric) | |
port="3000" | |
fi | |
pid=`lsof -wni tcp:$port | awk 'NR==2 { print $2 }'` | |
if [ -n "${pid}" ]; then | |
kill -9 $pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MPD_SERVER_HOSTNAME = u'::' | |
SPOTIFY_USERNAME = u'YOUR-USERNAME' | |
SPOTIFY_PASSWORD = u'YOUR-PASSWORD' | |
HTTP_SERVER_HOSTNAME = u'::' | |
HTTP_SERVER_PORT = 6680 | |
HTTP_SERVER_STATIC_DIR = u'/var/www/mopidy/current/public' | |
LOCAL_MUSIC_PATH = u'/home/bbox/music' | |
LOCAL_TAG_CACHE_FILE = u'/home/bbox/tag_cache' | |
FRONTENDS = ( | |
u'mopidy.frontends.mpd.MpdFrontend', |
OlderNewer