Heroku is a simple way to publish your Rails app, and a powerful platform that will allow it to scale. In this episode, Jay McGavren gets you started with your first Heroku app.
- You WANT Rails to fail locally if a gem isn't in your Gemfile
/** | |
* Example of using an angular provider to build an api service. | |
* @author Jeremy Elbourn (@jelbourn) | |
*/ | |
/** Namespace for the application. */ | |
var app = {}; | |
/******************************************************************************/ |
Greybeard | |
An aging [unix hacker] type with an impressive [unix beard] that has now turned grey. Originally a young [neckbeard], these [Gandalf] resembling [curmudgeons] are renowned for their knowledge of theoretical computer science, arcane unix and complete inability to use a remotely contemporary computer. | |
Typically employed in academia, they are a dying breed from an antediluvian age of 8" [floppies], magnetic tape and timeshared computing. Despite having invented multiuser OSes and the internet, Greybeards prefer to live in the past, where they consider [Fortran] to be a high level programming language. Typical Greybeard computers are dated [Sun workstations] or old PCs running a command line only [BSD] variant, Greybeards shun GUIs, unless they're horrible and dated, like CDE or [Amiga] Workbench. | |
Some, like Edsger Dijkstra do most of their computer science as entirely theoretical exercises on paper and haven't programmed a computer since 1972. | |
Contacting a gr |
// Create a factory object that can be used to swap out the prototype used | |
// to instantiate new instances. | |
var factory = {}; | |
factory.proto = {foo: 'bar'}; | |
factory.create = function () { return Object.create(this.proto); }; | |
var t1 = factory.create(); |
var myPrototype = { | |
methodA: function methodA() {}, | |
methodB: function methodB() {}, | |
methodC: function methodC() {} | |
}; | |
createFoo = function createFoo() { | |
return (Object.create(myPrototype)); | |
}; |
Heroku is a simple way to publish your Rails app, and a powerful platform that will allow it to scale. In this episode, Jay McGavren gets you started with your first Heroku app.
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
import org.apache.commons.codec.binary.Base64; | |
private String encodeFileToBase64Binary(String fileName) | |
throws IOException { | |
File file = new File(fileName); | |
byte[] bytes = loadFile(file); | |
byte[] encoded = Base64.encodeBase64(bytes); | |
String encodedString = new String(encoded); |