Skip to content

Instantly share code, notes, and snippets.

> 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
@ryandotsmith
ryandotsmith / a-backbone-js-demo-app-sinatra-backend.md
Created January 22, 2012 01:42
Backbone demo app with sinatra backend

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 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].

@teramako
teramako / nyancat.js
Created December 8, 2011 12:16
nyancatをコンソール出力
/*
* Nyancat (SpiderMonkey version)
* https://gist.github.com/1446827
*
* @see https://github.com/klange/nyancat
*/
function start() {
function frameIterator() {
while (true) {
@seki
seki / gist:1194969
Created September 5, 2011 13:14 — forked from makoto/gist:1159123
drubyコラム: Mustache (定型文書の生成とERB)

「{」の見た目から名付けられたMustacheというライブラリーが人気です。

https://github.com/defunkt/mustache

このテンプレートの面白いところは「極力ロジックを書かない」ことに注力したテンプレートだということです。以下がMustacheのホームページから抜粋した例です。

Hello {{name}}
You have just won {{value}} dollars!
{{#in_ca}}

Well, {{taxed_value}} dollars, after taxes.

@bradly
bradly / deploy.rake
Created July 27, 2011 03:58
Simple Rails Deployments with Net/SSH
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)
@j0sh
j0sh / Makefile
Created March 31, 2011 07:05
iOS static library cross-compile script.
# 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)
// ==UserScript==
// @name Social count
// @namespace http://june29.jp/
// @include http://*
// @include https://*
// ==/UserScript==
(function() {
if (window.top != window.self) exit;
@toshi-kawanishi
toshi-kawanishi / git-now
Created November 18, 2010 18:44
making convenient git commit
#!/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" ]