Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
#!/bin/sh | |
# we assume that we use system wide rvm installation (in /usr/local/rvm) | |
# and our application is deployed to /var/www/tld.appname directory | |
RVM_ENV="ruby-1.9.3-p0@gemset" | |
APP_DIR="tld.appname" | |
# load rvm | |
source /usr/local/rvm/environments/$RVM_ENV |
APP_PATH = "/var/www/tld.appname" | |
rails_env = ENV["RAILS_ENV"] || "development" | |
# 2 workers and 1 master | |
worker_processes 2 | |
working_directory APP_PATH + "/current" # available in 0.94.0+ | |
# Load rails+github.git into the master before forking workers |
These commands are good as of 2011-07-27.
App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.
object Download extends Controller { | |
import org.apache.commons.logging.Log | |
import org.apache.hadoop.conf.Configuration | |
import org.apache.hadoop.fs._ | |
import java.io.InputStream | |
import java.net.URI | |
import java.net.URLDecoder | |
def download(filename: String) = { |
import Benchmark._ | |
object App { | |
def main(args: Array[String]): Unit = { | |
benchmark(100000){ | |
report("foo"){ foo() } :: | |
report("bar"){ bar() } :: | |
Nil | |
} | |
} |
/** | |
* Upload action (for partial - AJAX uploads) | |
* Works with chunks of uploading files, save them to HDFS directly | |
*/ | |
def ajax() = { | |
response.setHeader("Access-Control-Allow-Origin", "*") | |
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS") | |
response.setHeader("Access-Control-Allow-Headers", "X-Requested-With,X-File-Name,Content-Type") | |
response.setHeader("Access-Control-Max-Age", "1728000") | |
location ~ ^.+\.(jpe?g|gif|png)$ { | |
rewrite ^(/object-images)/(\d+)/([0-9x]+)/(\d+)/([a-zA-Z0-9-]+).jpg$ $1/$2/$3/$4.jpg last; | |
try_files $uri /images/empty.png; | |
access_log off; | |
expires 3h; | |
} |