sudo apt-get install postgresql
sudo apt-get install pgadmin3
| $(document).on 'click', (e) -> | |
| target = $(event.target) | |
| unless target.parents().andSelf().is('#container') | |
| $('#container').hide(500) |
| ~~~ | |
| # Gemfile | |
| gem 'rails-api' | |
| gem 'active_model_serializers', :github => 'rails-api/active_model_serializers' | |
| gem 'batman-rails', git: 'git://github.com/Shopify/batman-rails.git' | |
| ~~~ | |
| ~~~ | |
| $ bundle |
| $open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app |
| <CORSConfiguration> | |
| <CORSRule> | |
| <AllowedOrigin>http://localhost:3000</AllowedOrigin> | |
| <AllowedMethod>GET</AllowedMethod> | |
| <AllowedMethod>POST</AllowedMethod> | |
| <AllowedMethod>PUT</AllowedMethod> | |
| <MaxAgeSeconds>3000</MaxAgeSeconds> | |
| <AllowedHeader>*</AllowedHeader> | |
| </CORSRule> | |
| </CORSConfiguration> |
| include Tire::Model::Search | |
| index_name INDEX_NAME | |
| # Update index only if user is active | |
| after_save do | |
| tire.update_index if self.active == true | |
| end | |
| # Update index only if user is active | |
| after_destroy do |
| Host machine shell: | |
| ssh vagrant@192.168.33.10 -L 9001:localhost:5432 |
| #!/usr/bin/env ruby | |
| puts "[Cheese!]" | |
| # Get some info about current commit | |
| repository_name = `basename "$PWD"`.chop | |
| commit_hash, commit_date = `git log -1 --pretty="%H%n%ci"`.split(/\r?\n/) | |
| # Capture image and save it to ~/Pictures/gitshots/REPOSITORYNAME-TIMESTAMP-COMMITHASH.jpeg | |
| exec "imagesnap ~/Pictures/gitshots/#{repository_name}_#{commit_date.gsub!(' ', '_')}_#{commit_hash}.jpeg" | |
| exit 1 |
| #!/usr/bin/env ruby | |
| puts "[Cheese!]" | |
| # Get some info about current commit | |
| repository_name = `basename "$PWD"`.chop | |
| commit_hash, commit_date = `git log -1 --pretty="%H%n%ci"`.split(/\r?\n/) | |
| # Capture image and save it to ~/Pictures/gitshots/REPOSITORYNAME-TIMESTAMP-COMMITHASH.jpeg | |
| exec "streamer -c /dev/video0 -b 16 -o ~/Pictures/gitshots/#{repository_name}_#{commit_date.gsub!(' ', '_')}_#{commit_hash}.jpeg" | |
| exit 1 |
| class ImageUploader < CarrierWave::Uploader::Base | |
| include CarrierWave::MiniMagick | |
| storage :file | |
| def thumb(size) | |
| begun_at = Time.now | |
| size.gsub!(/#/, '!') | |
| uploader = Class.new(self.class) | |
| uploader.versions.clear | |
| uploader.version_names = [size] |