| gem | draper | active_decorator |
| 参考URL | Railscast #286 | Rails3レシピブック外伝 recipe 10 |
| 反映タイミング | HogeDecorator 使用時 | view_assigns 時 |
| 関連対応 | decorates_association | partial render 時 |
参考:
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <!-- https://gist.github.com/3906168 --> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
| <meta name="viewport" content="user-scalable=no, width=device-width" /> | |
| <script type="text/javascript" src = "http://code.jquery.com/jquery-1.8.2.min.js"></script> | |
| <script type="text/javascript"> | |
| $(document).ready(function(){ | |
| window.addEventListener("devicemotion",onDeviceMotion,false); |
| class << I18n | |
| alias orig_translate translate | |
| def translate(*args) | |
| STDERR.puts args.inspect | |
| orig_translate(*args) | |
| end | |
| alias t translate | |
| end |
| gem | draper | active_decorator |
| 参考URL | Railscast #286 | Rails3レシピブック外伝 recipe 10 |
| 反映タイミング | HogeDecorator 使用時 | view_assigns 時 |
| 関連対応 | decorates_association | partial render 時 |
参考:
| % ruby -v gsub.rb | |
| ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] | |
| <a><b><c> | |
| % ruby -v gsub.rb | |
| ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] | |
| <a><b><c> |
| #!/bin/sh | |
| # LICENSE: MIT License. Copyright (C) 2012 Kazuhiro NISHIYAMA | |
| set -e | |
| IMAGES=/boot/knoppix | |
| . /usr/lib/grub/grub-mkconfig_lib | |
| knoppix_add () { | |
| echo "Found knoppix iso image: $image" >&2 |
| run-smily.sh |
| #!/bin/bash | |
| # usage: . ./woo_nyaa.bash | |
| LANG="ja_JP.UTF-8" | |
| WOO_NYAA_STRINT=( | |
| "(」・ω・)」うー!" | |
| "(/・ω・)/にゃー!" | |
| "(」・ω・)」うー!" | |
| "(/・ω・)/にゃー!" | |
| "(」・ω・)」うー!" |
| #include <stdio.h> | |
| int main() { | |
| FILE *fp = fopen("a-test.txt", "a+"); | |
| char buf[4]; | |
| printf("%ld\n", ftell(fp)); | |
| if (fgets(buf, sizeof(buf), fp)) | |
| printf("%s\n", buf); | |
| fputs("test", fp); | |
| printf("%ld\n", ftell(fp)); | |
| if (!fgets(buf, sizeof(buf), fp)) |
| #!/bin/sh | |
| exec 2>&1 | |
| logger -s -t runsv -- start "$(basename $(pwd))" | |
| USER=nadoka | |
| TARGET_UID=$(id -u $USER) | |
| TARGET_GID=$(id -g $USER) | |
| if [ -z "$TARGET_UID" -o -z "$TARGET_GID" ]; then | |
| logger -s -t runsv -- "id failed: UID=$TARGET_UID GID=$TARGET_GID" | |
| exec sleep 10 | |
| fi |