(This is a translation of ko1's blog. All mistakes are mine.)
This is the 8th day of the Ruby VM Advent Calendar.
I'm slowly running out of breath.
Today is,
# Video of it in action: http://cl.ly/VSIF | |
class MyScene < SKScene | |
def scroll_action(x, duration) | |
width = (x * 2) | |
move = SKAction.moveByX(-width, y: 0, duration: duration * width) | |
reset = SKAction.moveByX(width, y: 0, duration: 0) | |
SKAction.repeatActionForever(SKAction.sequence([move, reset])) | |
end |
export PS1="\n ࿐࿓ \[\033[4;36m\]\u\[\033[m\] \[\033[2m\]\w\[\033[m\] \[\033[31m\]$(ruby -e 'print RUBY_VERSION')\[\033[m\] $(ruby -e "t=Time.now.hour-12;h=t<0?8+t/6*4:3-t/4;f=h==0?'5;':'';puts\"\033[#{f}31m#{'♥'*h+'♡'*(4-h)}\033[m\"")\[\033[m\]\n༼つ◕_◕༽つ " |
#!/bin/bash | |
all_assets=`find $1 -type f | uniq | grep -v @2x` | |
for asset in $all_assets; do | |
name=`basename $asset | cut -d . -f 1` | |
count=`git grep $name | grep -v project.pbxproj: | wc -l` | |
echo -e "$count\t$asset" | |
done |
// 1. Containing app - Store token url in the group user defaults. | |
DBAccount *account = [[DBAccountManager sharedManager] handleOpenURL:url]; | |
if (account) { | |
NSUserDefaults *groupDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.example.app"]; | |
[groupDefaults setObject:url.absoluteString forKey:@"dropbox.token.url"]; | |
[groupDefaults synchronize]; | |
} | |
// 2. An Extension - Retrieve the token url from group user defaults, then give it to -[DBAccountManager handleOpenURL:] after setting "nonce". | |
NSUserDefaults *groupDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.example.app"]; |
#!/usr/bin/env ruby | |
STDIN.read.split("\n").each{ |line| puts line if (line =~ /CONFLICT/) } |
# | |
# Mirah REPL -- hacked to bits | |
# | |
# assuming your ruby is jruby, | |
# $ gem install mirah | |
# $ ruby -rubygems repl.rb | |
# m> class Foo | |
# m> def bar | |
# m> 12 | |
# m> end |
diff --git config.mk config.mk | |
index 8b453ec..d69b687 100644 | |
--- config.mk | |
+++ config.mk | |
@@ -46,7 +46,7 @@ have lua >= 5.1 installed) | |
endif | |
# Packages required to build luakit | |
-PKGS := gtk+-2.0 gthread-2.0 webkit-1.0 javascriptcoregtk-1.0 sqlite3 $(LUA_PKG_NAME) | |
+PKGS := icu-i18n gtk+-2.0 gthread-2.0 webkit-1.0 javascriptcoregtk-1.0 sqlite3 $(LUA_PKG_NAME) |
pkgname=lxc | |
pkgver=0.7.4.2 | |
pkgrel=1 | |
pkgdesc="Linux Containers" | |
arch=('i686' 'x86_64') | |
url="http://lxc.sourceforge.net/" | |
depends=('bash' 'perl') | |
license=('LGPL') | |
source=("http://lxc.sourceforge.net/download/lxc/$pkgname-$pkgver.tar.gz" lxc.rcd lxc.confd) | |
md5sums=('36fcb0f6a39d2f55130421f342f24ef3' '520594461912e084c220ca37eb97afd2' 'efb0c46839136842e9d3617924a9b5b5') |
from random import randint | |
from django.http import HttpResponse | |
class HTCPCPMiddleware(object): | |
""" | |
This middleware allows a your django project to act as a HTCPCP (Hyper | |
Text Coffee Pot Control Protocol) server. If the user requests to BREW | |
a coffee, and it is not on the list. Then it will get a `406 Not | |
Acceptable`, and randomly it will respond with `418 I'm a teapot`. | |
(This is a translation of ko1's blog. All mistakes are mine.)
This is the 8th day of the Ruby VM Advent Calendar.
I'm slowly running out of breath.
Today is,