Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
Automtically configure tab name in Terminal.app when ssh-ing to a server. You can use any shell commands you want to get the desired output.
I work on external servers 8 hours a day M-F and more likely than not I have multiple ssh sessions at the same time to the same sever under different users. It became a bit of a pain to have to rename the tabs everytime I logged on to a server. I just wanted that to happen auto-magically.
I searched the interwebs and came across this CNet article which had about 99% of what I was looking for. However, it never really mentioned how to modify the script to insert your own formatting. It didn't even mention adding it to your $PATH! So after a few minutes of messing with it I got something quite reasonable. I thought I'd share the results.
import os | |
import sys | |
import readline | |
import glob | |
class tabCompleter(object): | |
""" | |
A tab completer that can either complete from | |
the filesystem or from a list. | |
It's a collection of CSS styles and Javascript add-ons that stop your site from looking like a shitty craigslist rip off from 1996. Seriously, who wants that?
Docs: CSS, Components, Javascript
Finding the right gem, keeping it updated, and learning the syntax is a pain in the ass. Why not install Bootstrap the way you'd install new javascript libraries?
Bootstrap 3.0 gives you access to the awesome icon set icon set by these dudes but it's not obvious for a Rails newbie like myself to get it all working together nicely
- Download the bootstrap-glyphicons.css from here. Save that file to
RAILS_ROOT/vendor/assets/stylesheet/bootstrap-glyphicons.css
- Save all the font files in
/dist/fonts
from the Bootstrap 3.0 download to a new folder in your Rails appRAILS_ROOT/vendor/assets/fonts
- Add this folder to the asset pipeline by appending
config.assets.paths << Rails.root.join("vendor","assets", "fonts")
toapplication.rb
after the line that hasclass Application < Rails::Application
. - In
bootstrap-glyphicons.css
modify the the `url
OS X Mavericks has some some seriously awesome dual screen support (Mutha-Fuckin' finally, AMIRITE?) but there seems to be a bug if you have your docked pinned to either side of your display.
Unfortunately, it means moving your dock :-(
Sad times my friends.
You know what method is being and you want to figure out how it got there. Raising an exception is a bit harsh since all you want is a stack trace
puts caller
Seriously. It's that easy. If you're getting too much information you could
class Array | |
# find_insert_index -> returns the index that the value should be inserted into | |
# to keep the array sorted | |
# Arguments | |
# val -> any sort of value that supports comparison or... | |
# &block -> If you want to compare a specific field on your object you could: | |
# {|x,y| x.FIELD <=> y.FIELD } | |
# or you could sort reverse: | |
# {|x,y| y <=> x} NOTE: your review must be sorted desc. for this to work. |