- Create a file to store our credentials:
sudo vim /etc/postfix/sasl_passwd
# ------- | |
# 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 |
sudo vim /etc/postfix/sasl_passwd
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 |
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 |
# 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 |
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: |
# 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) ) |
Step by step instructions for deploying react-vr/tree/master/Examples/TourSample to Heroku.
# 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 script will allow switching between managed
and monitor
mode for a wireless adapter.
Managed mode is the default wireless adapter mode.
Monitor mode allows monitoring all traffic received on a wireless channel and allows packets to be captured without having to associate with an access point.