This guide will get you started using Spark on Heroku/Cedar. Spark is basically a clone of Sinatra for Java. 'Nuff said.
Create a single Java main class in src/main/java/HelloWorld.java
:
:::java
import static spark.Spark.*;
import spark.*;
#!/bin/bash | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <[email protected]> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
# Some good references are: | |
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x | |
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/ | |
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392 | |
#1. Install PostgreSQL postgis and postgres | |
brew install postgis | |
initdb /usr/local/var/postgres | |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real
upstream your-app { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a | |
# single worker for timing out). | |
server unix:/tmp/your_app.socket fail_timeout=0; | |
} | |
server { | |
listen 80; |
# Copy it to fnordmetric directory and run with | |
# | |
# bundle exec ruby -Ilib -I. populate.rb live | |
# | |
# to generate fake current traffic or | |
# | |
# bundle exec ruby -Ilib -I. populate.rb past | |
# | |
# to generate fake stats for last month. | |
# |
var express = require('express'); | |
var OAuth = require('oauth').OAuth2; | |
var app = express.createServer(); | |
var _foundryConsumerKey = "YOURFOUNDRYKEY"; | |
var _foundryConsumerSecret = "YOURFOUNDRYSECRET"; | |
var _redirectUri = "http://hello-att-foundry-node.heroku.com/auth/callback"; | |
var consumer = new OAuth(_foundryConsumerKey, |
source :rubygems | |
gem 'rack', "~> 1.3.6" | |
gem 'sinatra' | |
gem 'json' | |
gem 'oauth2' |
/** | |
* Basic bookmarklet template. | |
* | |
* Change the `iframeSrc` variable to point to your space's new idea | |
* page. You can adjust the iframe styles and position using the | |
* `iframeStyle` variable. | |
* | |
* For turning this script into a bookmarklet, you should probably take | |
* a look at https://gist.github.com/1856012. | |
*/ |