This file contains hidden or 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
ALTER TABLE my_table ALTER COLUMN my_column DROP DEFAULT; | |
ALTER TABLE my_table ALTER my_column TYPE bool USING CASE WHEN my_column=0 THEN FALSE ELSE TRUE END; | |
ALTER TABLE my_table ALTER COLUMN my_column SET DEFAULT FALSE; |
This file contains hidden or 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
CREATE SEQUENCE feedbacks_id_seq; | |
ALTER TABLE feedbacks ALTER COLUMN id SET DEFAULT nextval('feedbacks_id_seq'::regclass); | |
ALTER SEQUENCE feedbacks_id_seq OWNED BY feedbacks.id; | |
select setval('feedbacks_id_seq', (select max(id)+1 from feedbacks), false); |
This file contains hidden or 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
bundle config build.pg --with-pg-include='/Applications/Postgres.app/Contents/Versions/9.3/include/' | |
bundle config build.nokogiri --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/ |
This file contains hidden or 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
development: &development | |
adapter: postgresql | |
database: <%= Rails.application.class.parent_name.underscore %>_development | |
host: localhost | |
pool: 5 | |
timeout: 5000 | |
test: | |
<<: *development | |
database: <%= Rails.application.class.parent_name.underscore %>_test | |
production: |
This file contains hidden or 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
items = { | |
'orange' => 'shoes', | |
'pink' => 'skirt', | |
'borwn' => 'socks', | |
'blue' => 'hat' | |
} | |
items.each.with_index(1) do |(color, item), index| | |
puts "#{index}. Please wear your #{color} #{item}." | |
end |
This file contains hidden or 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
if defined?(AssetSync) | |
AssetSync.configure do |config| | |
config.fog_provider = 'AWS' | |
config.aws_access_key_id = ENV['AWS_ACCESS_KEY_ID'] | |
config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] | |
config.fog_directory = ENV['FOG_DIRECTORY'] | |
config.manifest = false | |
config.existing_remote_files = 'ignore' |
This file contains hidden or 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
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="all.css" media="all" /> | |
<link rel="stylesheet" type="text/css" href="screen.css" media="screen" /> | |
</head> | |
<body> | |
<p class="test_paragraph">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eleifend congue vehicula. Nullam tempor volutpat nisi et dictum. Vestibulum dictum ipsum massa, eget dapibus est posuere vel. Donec a magna justo. Curabitur et erat non erat porta porttitor. Ut tristique eleifend diam cursus lacinia. Nam ultricies mi tincidunt lobortis tincidunt. Duis ac mi tempus, auctor augue sed, accumsan ante. Nunc dictum tempus ullamcorper. Nunc ullamcorper placerat gravida.</p> | |
<p class="test_paragraph">Maecenas convallis neque tortor, non sodales dui tristique eu. Integer condimentum enim ac mollis sagittis. Suspendisse elementum, tellus quis pretium rutrum, nunc urna eleifend neque, at feugiat ligula justo porta lectus. Praesent in consequat felis. Quisque suscipit auctor mattis. Proin eleifend arcu non l |
This file contains hidden or 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
#!/usr/bin/ruby | |
def is_git_repo | |
%x[git rev-parse 2>&1] | |
$?.exitstatus == 0 | |
end | |
dir_to_scan = if ARGV[0] | |
if ARGV[0] !~ /^\// | |
"#{Dir.pwd}/#{ARGV[0]}" |
This file contains hidden or 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
# rails_apps_composer template ~/template.rb -d defaults.yaml | |
# rails new app_name -m ~/template.rb | |
recipes: | |
- apps4 | |
- controllers | |
- core | |
- extras | |
- frontend |
This file contains hidden or 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
# encoding: UTF-8 | |
namespace :simulator do | |
desc "Call 'Reset Content and Settings' in iOS Simulator menu" | |
task :reset do | |
%x{ | |
osascript <<-END | |
tell application "iPhone Simulator" to activate | |
tell application "System Events" | |
tell process "iPhone Simulator" |