Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
| // An intersting pattern for testing, but you can use the check anywhere | |
| import "testing" | |
| func TestCheckingChannel(t *testing.T) { | |
| stop := make(chan bool) | |
| // Testing some fucntion that SHOULD close the channel | |
| func (stop chan bool) { | |
| close(chan) | |
| }(stop) |
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
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/fontsfrom 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.rbafter the line that hasclass Application < Rails::Application. - In
bootstrap-glyphicons.cssmodify the the `url
Sometimes you need to iterate over a ton of items and you don't want the overhead of creating AR objects out of all of them. Hell, you only need a few things! Well, #pluck has your back.
But what if you want to iterate over many tonnes of items?
Pluck in batches to the rescue!
This isn't the exact code that I use in my code base, but it is damn close.
| 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?
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.