Oct 16 2010
- 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments
In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].
> perl -E 'say "生" & "死"' | |
愛 | |
生 Life U+751F \xe7\x94\x9f 11100111 10010100 10011111 | |
死 Death U+6B7B \xe6\xad\xbb 11100110 10101101 10111011 | |
愛 Love u+611B \xe6\x84\x9b 11100110 10000100 10011011 |
/* | |
* Nyancat (SpiderMonkey version) | |
* https://gist.github.com/1446827 | |
* | |
* @see https://github.com/klange/nyancat | |
*/ | |
function start() { | |
function frameIterator() { | |
while (true) { |
「{」の見た目から名付けられたMustacheというライブラリーが人気です。
https://github.com/defunkt/mustache
このテンプレートの面白いところは「極力ロジックを書かない」ことに注力したテンプレートだということです。以下がMustacheのホームページから抜粋した例です。
Hello {{name}}
You have just won {{value}} dollars!
{{#in_ca}}
Well, {{taxed_value}} dollars, after taxes.
require 'net/ssh' | |
desc "Deploy site to production" | |
task :deploy => :environment do | |
host = 'yourhost.com' | |
user = 'username' | |
options = {:keys => '~/.ssh/keys/yourserver.pem'} | |
remote_path = '/path/to/rails_app' | |
commands = [ |
require 'net/http' | |
require 'uri' | |
Net::HTTP.version_1_2 | |
class MyHTTPClient | |
@@debug_output = nil | |
def self.get(url) | |
uri = URI(url) |
# iOS builds for ARMv7 and simulator i386. | |
# Assumes any dependencies are in a local folder called libs and | |
# headers in a local folder called headers. | |
# Dependencies should already have been compiled for the target arch. | |
PROJ=untitled | |
ifeq ($(IOS), 1) | |
ARCH=armv7 | |
DEVICE=OS | |
CC_FLAGS=-arch $(ARCH) |
#!/bin/sh | |
PREFIX="from now" | |
MESSAGE="[${PREFIX}] `date`" | |
if [ $# -eq 0 ] | |
then | |
git add -u | |
printf "${MESSAGE}\n\n%s" "`git diff --cached`" | git commit -F - | |
elif [ $1 != "--rebase" ] |