$ rails g model User
belongs_to
has_one
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use FindBin; | |
| use Text::MicroTemplate::File; | |
| my $info = qx{/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I}; | |
| my ($ssid) = $info =~ / SSID: (.*)$/m; |
| t = 236 # seconds | |
| Time.at(t).utc.strftime("%H:%M:%S") | |
| => "00:03:56" | |
| # Reference | |
| # http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.graphics.Matrix; | |
| /** | |
| * 画像変換クラス | |
| * | |
| */ | |
| public class BitmapUtil { |
| # 少し凝った zshrc | |
| # License : MIT | |
| # http://mollifier.mit-license.org/ | |
| ######################################## | |
| # 環境変数 | |
| export LANG=ja_JP.UTF-8 | |
| # 色を使用出来るようにする |
| public enum FaceNameEye { | |
| Mabataki("まばたき"), | |
| Warai("笑い"), | |
| Wink_L("ウインク"), | |
| Wink_l2("ウインク2"), | |
| final String name; | |
| FaceNameEye(String name) { | |
| this.name = name; |
| var w = { | |
| width : 100, | |
| height: 200, | |
| center : function() { | |
| return { | |
| x : this.width /2, | |
| y : this.height/2 | |
| }; | |
| } | |
| }; |
AGQR の放送を保存するスクリプト.
というバグが存在する.
| fs = require('fs') | |
| readline = require('readline') | |
| google = require('googleapis') | |
| googleAuth = require('google-auth-library') | |
| calendar = google.calendar('v3') | |
| SCOPES = [ 'https://www.googleapis.com/auth/calendar.readonly' ] | |
| TOKEN_DIR = (process.env.HOME or process.env.HOMEPATH or process.env.USERPROFILE) + '/.credentials/' | |
| TOKEN_PATH = TOKEN_DIR + 'calendar-api-quickstart.json' | |
| # Create an OAuth2 client with the given credentials, and then execute the |