Step by step instructions for deploying react-vr/tree/master/Examples/TourSample to Heroku.
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
# resource - http://richardlog.com/post/12743073497/pretty-printing-json-and-xml-on-mac-osx | |
# Formatting XML | |
cat unformatted.xml | xmllint --format - > formatted.xml | |
# Formatting JSON | |
cat unformatted.json | python -m json.tool > formatted.json |
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
# Use raw sql to calculate distance between latitude/longitude coordinates | |
# From the web | |
# - http://gis.stackexchange.com/questions/31628/find-points-within-a-distance-using-mysql | |
"SELECT | |
id, ( | |
3959 * acos ( | |
cos ( radians(78.3232) ) | |
* cos( radians( lat ) ) | |
* cos( radians( lng ) - radians(65.3234) ) |
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
For each Ruby module/class, we have Ruby methods on the left and the equivalent | |
Clojure functions and/or relevant notes are on the right. | |
For clojure functions, symbols indicate existing method definitions, in the | |
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can | |
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master, | |
ruby-to-clojure.*/* functions can be obtained from the source files in this | |
gist. | |
If no method symbol is given, we use the following notation: |
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
# Add 'config.development_environments = []' to config/initializers/airbrake.rb | |
Airbrake.configure do |config| | |
config.api_key = "1234" | |
config.environment_name = AppConfig.environment if AppConfig.environment | |
config.secure = true | |
config.development_environments = [] | |
end | |
# Test it out in the console | |
1) rails console |
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
http://stackoverflow.com/questions/24081473/how-to-install-therubyracer-gem-on-10-10-yosemite | |
gem uninstall libv8 | |
brew install v8 | |
gem install therubyracer | |
gem install libv8 -v '3.16.14.3' -- --with-system-v8 |
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
gem install less --no-ri --no-rdoc | |
gem install therubyracer --no-ri --no-rdoc | |
lessc app/assets/stylesheets/less/mobile/common/core.less > app/assets/stylesheets/css/mobile/core.css | |
1) delete associated css file(s) for modified less file(s) from public/assets/***.css | |
2) bundle exec rake assets:precompile |
- Create a file to store our credentials:
sudo vim /etc/postfix/sasl_passwd
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
# ------- | |
# rubocop | |
# ------- | |
# example usage: | |
# check a directory: rubocop app/controllers | |
# check a file: rubocop app/controllers/application_controller.rb | |
# check rspec directory: rubycop spec/controllers | |
# check rspec file: rubycop spec/controllers/application_controller_spec.rb | |
run_rubocop(){ | |
if gem list | gem list | grep 'rubocop\|rubocop-rspec' ; then |
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
# lib/paperclip_processors/cropper.rb | |
module Paperclip | |
class Cropper < Thumbnail | |
def transformation_command | |
if crop_command | |
puts "CROP: #{crop_command + super.join(' ').sub(/ -crop \S+/, '').split(' ')}" | |
crop_command + super.join(' ').sub(/ -crop \S+/, '').split(' ') | |
else | |
super | |
end |