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
c = ActiveRecord::Base.connection | |
c.tables.collect do |t| | |
columns = c.columns(t).collect(&:name).select {|x| x.ends_with?("_id" || x.ends_with("_type"))} | |
indexed_columns = c.indexes(t).collect(&:columns).flatten.uniq | |
unindexed = columns - indexed_columns | |
unless unindexed.empty? | |
puts "#{t}: #{unindexed.join(", ")}" | |
end | |
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
#opacity-rule = ["99:class_g = 'Terminator'"]; | |
#opacity-rule = ["85:class_g = 'Termite'"]; | |
opacity-rule = ["99:class_g = 'Termite'"]; | |
# Shadow | |
shadow = true; | |
no-dnd-shadow = true; | |
no-dock-shadow = true; | |
clear-shadow = true; | |
shadow-radius = 4; | |
shadow-offset-x = 0; |
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
"Pathogen - manage plugins | |
"------------------------------------------------------------------------- | |
execute pathogen#infect() | |
"--------------------------------------------------------------------------- | |
" Basic settings | |
"------------------------------------------------------------------------- | |
let g:ruby_path = system('echo $HOME/.rbenv/shims') | |
let mapleader = "\<Space>" |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# set show-mode-in-prompt on | |
# set vi-ins-mode-string \1\2 \1\2 | |
# set vi-cmd-mode-string \1\2 \1\2 | |
ranger() { | |
if [ -z "$RANGER_LEVEL" ]; then |
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
<div class="container"> | |
<% flash.each do |type, msg| %> | |
<div class="alert <%= bootstrap_class_for_flash(type) %> alert-dismissable fade show"> | |
<%= msg %> | |
<button class="close" data-dismiss="alert">x</button> | |
</div> | |
<% end %> | |
</div> |
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
default: &default | |
adapter: mysql2 | |
encoding: utf8 | |
pool: 5 | |
username: | |
password: | |
socket: /var/run/mysqld/mysqld.sock | |
development: | |
<<: *default |
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
guard 'livereload' do | |
extensions = { | |
css: :css, | |
scss: :css, | |
sass: :css, | |
js: :js, | |
coffee: :js, | |
html: :html, | |
png: :png, | |
gif: :gif, |
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 slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
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
#!/bin/bash | |
# install jq JSON processor | |
# apt isntall jq | |
pretty_curl() { | |
curl "$1" | jq | |
} |
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
module ApplicationHelper | |
def active_for(options = {}) | |
name_of_controller = options[:controller] || nil | |
name_of_action = options[:action] || nil | |
request_path = options[:path] || nil | |
if request_path.nil? | |
if (name_of_action.nil? or name_of_action == action_name) and | |
name_of_controller == controller_name | |
'active' |
OlderNewer