Source: https://www.wired.com/story/5-useful-terminal-tricks-for-mac/
sudo shutdown -h \+60
sudo killall shutdown
caffeinate -u -t 3600
Source: https://www.wired.com/story/5-useful-terminal-tricks-for-mac/
sudo shutdown -h \+60
sudo killall shutdown
caffeinate -u -t 3600
The following explains how to install the Whitespace Bundle for TextMate2. | |
1) mkdir -p ~/Library/Application\ Support/Avian/Bundles | |
2) cd ~/Library/Application\ Support/Avian/Bundles | |
3) git clone https://github.com/mads379/Whitespace.tmbundle.git | |
4) Open TextMate > Preferences | |
5) Create a Variable named 'Invalid' with a value of 'Red'(or whatever color you choose) | |
6) Restart TextMate |
Assumptions: The application already exists. You have two models article.rb
and comment.rb
. Articles have two attributes, title
and text
. Comments have two attributes, text
and article_id
. See these instructions if you need help getting started.
Assuming that you are nesting your :comments
resources inside of :articles
, mount ActionCable
and make sure you have a root.
config/routes.rb
Rails.application.routes.draw do
http://robots.thoughtbot.com/post/47202759358/using-gdb-to-inspect-a-running-ruby-process
That’s not a great thing to have to say, is it? However, I bet you’ve said it before and may not have immediately know why.
With liberal use of puts and maybe pry, you can figure out what a problem might be next time you run it, but sometimes you need to figure out what that problem is right now.
As it turns out, and I know this is a shocker, Ruby processes are just regular processes. They can be debugged with gdb.
Having recently had the need to find out why a job of mine was running particularly slowly, I found out about this lovely tool the hard way: frantic googling. I found some very useful functions for gdb in a blog post by Rasmus on Ruby callstacks.
Step by step instructions for deploying react-vr/tree/master/Examples/TourSample to Heroku.
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.
# 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 |
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 |
# 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) ) |