This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var adjustAspectRatio = function (rectObj, wRetio, hRetio) { | |
if ((typeof rectObj.width === 'undefined' || rectObj.width === null) | |
|| (typeof rectObj.height === 'undefined' || rectObj.height === null)) { | |
console.error('Error : Object is not rect!'); | |
return; | |
} | |
if (rectObj.width > rectObj.height * wRetio / hRetio) { | |
rectObj.width = rectObj.height * wRetio / hRetio; | |
} | |
else if (rectObj.height > rectObj.width * hRetio / wRetio) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// twilio-node sample code "One-ring Call" | |
var twilio = require('twilio'); | |
var client = twilio('1234567890', '0987654321'); | |
client.calls.create({ | |
to: '+81xxxxxxxxxx', | |
from: '+81zzzzzzzzzz', | |
url: 'http://twilio-sample.com' | |
}, function (err, call) { | |
if(err) { | |
console.log(err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 半全角カナ変換モジュール | |
* @return {[type]} [description] | |
*/ | |
var kanaConverter = (function() { | |
// マップ作成用関数 | |
var createKanaMap = function(properties, values) { | |
var kanaMap = {}; | |
// 念のため文字数が同じかどうかをチェックする(ちゃんとマッピングできるか) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Note: Skip initialization for vim-tiny or vim-small. | |
if !1 | finish | endif | |
if has('vim_starting') | |
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
set runtimepath+=~/.vim/bundle/neobundle.vim/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ex.1 | |
find ./ -type f -print | xargs grep 'foo' * | |
# Ex.2 | |
grep -r 'foo' . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Collections; | |
public class RandomListSample { | |
public static void main(String[] args) { | |
RandomList taskList = new RandomList( | |
new RandomList("a", "b", "c"), | |
new RandomList(1, 2, 3, 4, 5), | |
new RandomList("太郎", "次郎") | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.sqltest; | |
import android.app.Activity; | |
import android.content.ContentValues; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.database.sqlite.SQLiteDatabase; | |
import android.database.sqlite.SQLiteOpenHelper; | |
import android.os.Bundle; | |
import android.util.Log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.customlist; | |
import java.util.List; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ArrayAdapter; | |
import android.widget.TextView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MSG_HELLO = 'おはようございます(・∀・)\n勤怠管理システムからの打刻を忘れないようにしましょう!\n' + KINTAI_SYSTEM_URL; | |
var MSG_GOODBYE = 'おつかれさまでした(*´ω`*)\n勤怠管理システムからの打刻を忘れないようにしましょう!\n' + KINTAI_SYSTEM_URL; | |
function helloMessage() { | |
var client = ChatWorkClient.factory({token: TOKEN}); //チャットワークAPIトークン | |
client.sendMessage({ | |
room_id:ROOM_ID, //ルームID | |
body: MSG_HELLO | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# % (String) - https://docs.ruby-lang.org/ja/latest/class/String.html#I_--25 | |
puts "%02d" % 0 # 00 | |
puts "%02d" % 9 # 09 | |
puts "%02d" % 99 # 99 | |
puts "%02d" % 100 # 100 | |
puts "%04d" % 0 # 0000 | |
puts "%04d" % 9 # 0009 | |
puts "%04d" % 99 # 0099 | |
puts "%04d" % 100 # 0100 | |
puts "%04d" % 9999 # 9999 |
OlderNewer