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
huiming@mars:natives (master=)$ time be rake | |
/Users/huiming/.rubies/ruby-1.9.3-p429/bin/ruby -S rspec spec/natives/apps/detect_spec.rb spec/natives/apps/list_spec.rb spec/natives/catalog/loader_spec.rb spec/natives/catalog/merger_spec.rb spec/natives/catalog/normalizer_spec.rb spec/natives/catalog/selector_spec.rb spec/natives/catalog/validator_spec.rb spec/natives/catalog_spec.rb spec/natives/gemfile_viewer_spec.rb spec/natives/host_detection/package_provider_spec.rb spec/natives/host_detection/platform_spec.rb spec/natives/host_detection_spec.rb | |
........................................................... | |
Finished in 12.5 seconds | |
59 examples, 0 failures | |
real 0m19.849s | |
user 0m14.280s | |
sys 0m1.425s |
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 ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
# NEW WAY / EASY WAY | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.7.deb | |
sudo dpkg -i elasticsearch-0.90.7.deb |
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 | |
_now=$(date +"%Y-%m-%d-%H%M%S") | |
_file="/u/backups/foo/pg-$_now.dump" | |
sudo -u postgres pg_dump -Fc foo_production > "$_file" |
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 -e | |
export RBENV_ROOT=/usr/local/rbenv | |
export PATH=/usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/bin:"$PATH" | |
APP="<%= @options[:app].application.name %>" | |
APP_PATH="<%= @options[:app].path %>" | |
RAILS_ENV="<%= @options[:rails_env] %>" | |
UNICORN_CONFIG="/etc/unicorn/${APP}.rb" | |
CUR_PID_FILE="${APP_PATH}/shared/pids/unicorn.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
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) | |
$LOAD_PATH.unshift(File.dirname(__FILE__)) | |
require 'rspec' | |
# Requires supporting files with custom matchers and macros, etc, | |
# in ./support/ and its subdirectories. | |
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} | |
module FixtureSupport |
I recently got PATCH mostly working with Backbone and Rails 3, here's what I needed to do.
Sticking Points:
- [Rails] JSON Patch gem needs updated.
- [Rails] Routing verb for patch missing - I believe this is fixed in Rails 4, haven't investigated.
- [Rails] Need to parse the 'application/json-patch+json' content type in sort of a crazy way
- [Rails] Building a patch and applying it to an activerecord model is kind of a pain, ideally we'd have a
ActiveModel#apply_patch(json_patch)
- [Backbone] Building a patch from a set of attributes is tricky - I've done the bare minimum using a loop over a hash to build add operations, which should probably cover a good chunk of cases for backbone. (I imagine most people aren't going to need the json-patch support for moving, copying or deleting keys generally.)