ruby 1.9.2 + async_sinatra + thin thin start
ab -n 10000 -c 100 http://localhost:3000/
-> 49ms / request
node server.js
Installing Ruby Enterprise Edition, Apache, MySQL, and Passenger for deploying Rails 3.0 applications.
Get a Linode, and set it up with Ubuntu 10.04 LTS so that you have till April 2013 to get updates. Once the Linode is formatted, boot it and continue on.
Set up an 'A' record in your DNS, pointing to the IP of your Linode. I'm using demo.napcs.com
here.
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script> | |
<script> | |
$(document).ready(function(){ | |
function debug(str){ $("#debug").append("<p>"+str+"</p>"); }; | |
if(typeof WebSocket === 'undefined') { | |
alert("Your browser does not support websockets.") | |
} |
#In Rakefile, set something like app.interface_orientations = [:portrait, :landscape_left, :landscape_right] | |
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
application.setStatusBarStyle(UIStatusBarStyleBlackOpaque, animated:true) | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
@window.rootViewController = NavigationController.alloc.initWithRootViewController(PortraitViewController.alloc.init) | |
@window.makeKeyAndVisible | |
true | |
end |
# -*- coding: utf-8 -*- | |
$:.unshift("/Library/RubyMotion/lib") | |
require 'motion/project/template/osx' | |
Motion::Project::App.setup do |app| | |
# Use `rake config' to see complete project settings. | |
app.name = 'MenubarApp' | |
app.info_plist['NSUIElement'] = 1 | |
end |
#!/usr/bin/env bash | |
set -u | |
set -e | |
export GIT_WORK_TREE="/var/www/example.com" | |
export NODE_VERSION="0.10" | |
echo "--> Checking out..." | |
git checkout -f |
#!/bin/bash | |
# -------------------------------------------------------------------------------------------- | |
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian) | |
# | |
# Run from the web: | |
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh) | |
# -------------------------------------------------------------------------------------------- | |
# Set the Ruby version you want to install |
class AppDelegate | |
include Async | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
thread_1 = async do | |
i = 0 | |
300_000.times do | |
sleep 0.000001 |
class MainActivity < Android::App::Activity | |
include ViewGeneration | |
def generate_screen | |
root_view( | |
horizontal_layout(:row0, text_view(:title, "a dark room")), | |
horizontal_layout(:row1, | |
hidden_button(:outside_button, "a silent forest"), | |
hidden_button(:embark_button, "a dusty path") | |
), |
class CellLayout < MotionKit::Layout | |
include CommonStyles | |
def layout | |
root :cell do | |
add contentView, :content_view do | |
add(UIView, :container) { cell_content_layout } | |
end | |
end | |
end |