Skip to content

Instantly share code, notes, and snippets.

View kuronekomichael's full-sized avatar
🤡
“You cheated not only the game, but yourself"

Koki Nakashima kuronekomichael

🤡
“You cheated not only the game, but yourself"
View GitHub Profile
@kuronekomichael
kuronekomichael / migrate_selenium2.js
Created December 13, 2013 10:16
Selenium RCからWebDriverに移行するための、シンプルな4つの手順
// Selenium RCの場合 => openの後waitが必要
selenium.open("http://www.google.com");
selenium.waitForPageToLoad();
selenium.typeKeys("name=q", "bears");
// WebDriverの場合 => openの中で暗黙的にwaitしているので、わざわざ記述は要らない
selenium.open("http://www.google.com");
selenium.typeKeys("name=q", "bears");
@kuronekomichael
kuronekomichael / migrate_selenium1.js
Created December 13, 2013 10:14
Selenium RCからWebDriverに移行するための、シンプルな4つの手順
// Selenium RCの場合
selenium.chooseCancelOnNextConfirmation();
selenium.click("id=foo");
// WebDriverの場合
webdriver.findElement(By.id("foo")).click();
webdriver.switchTo().alert().dismiss();
@kuronekomichael
kuronekomichael / wordRegister.scpt
Last active March 14, 2022 08:45
ことえり単語登録に文字を入力するApple Script -- appleScript, apple script, AppleScript
-- ことえり単語登録(== "WordRegister")
tell application "WordRegister"
activate
end tell
tell application "System Events"
-- 単語の欄にペースト
@kuronekomichael
kuronekomichael / subl.scpt
Created October 22, 2013 07:49
Sublime Text 2でメニューから行を選択してカットするApple Script -- applescript, apple script AppleScript
-- Sublime Text 2をアクティブにする
tell application "Sublime Text 2"
activate
end tell
-- Sublime Text 2の現在行を選択して、切り出す
tell application "System Events"
@kuronekomichael
kuronekomichael / post-checkout
Last active October 27, 2020 08:55
git clone元のサーバによって、user.nameやuser.emailを切り替えるフックスクリプト git clone hook post checkout
#!/bin/sh
# post-checkout
# =============
# arguments
# $1: ref of the previous HEAD e.g.) 0000000000000000000000000000000000000000
# $2: ref of the new HEAD e.g.) 959224d097072c8a5640fee31bac7325710eada1
# $3: flag = ブランチをチェックアウトした場合=1, ファイルをチェックアウトした場合=0
# `git clone`時だけ処理をしたいので、通常の`git checkout`時には何もしない
if [ "$1" != "0000000000000000000000000000000000000000" -o "$3" != "1" ]; then
@kuronekomichael
kuronekomichael / .gitignore
Created September 23, 2013 15:19
とりあえずの .gitignore みたいな
## Node ##
#------------
npm-debug.log
node_modules
## OSX ##
#------------
.DS_Store
.AppleDouble
.LSOverride
@kuronekomichael
kuronekomichael / index.js
Created September 6, 2013 15:06
expressで静的なJSONを返すだけのサーバを極力小さいコードで書いた感じ $ npm init $ npm install express --save-dev $ npm start
var express = require('express'),
port = 48172,
ret = { name:'hello', value:'world' };
express().get('/', function(req, res) {
res.contentType('application/json').send(JSON.stringify(ret));
}).listen(port, function() {
console.log("express server on localhost:%d", this.address().port);
});
@kuronekomichael
kuronekomichael / setup_tern_for_sublime.sh
Created September 3, 2013 04:11
Package Controlでtern_for_sublimeを入れた後の、仕上げの設定
cd "${HOME}/Library/Application Support/Sublime Text 2/Packages/tern_for_sublime"
npm install
@kuronekomichael
kuronekomichael / Sample.sublime-project
Last active December 22, 2015 04:48
Sublime Text2 のプロジェクト設定ファイルのひな形です。 「除外ファイルってどうやるんだっけ?」とか「個別の設定ってトップレベルで良かったっけ?」とかすぐに忘れちゃうので(;^ω^)
{
"folders":
[
{
// プロジェクトに含めるディレクトリ
"path": ".",
// 除外するディレクトリパターン
"folder_exclude_patterns": [],
// 除外するファイルパターン
"file_exclude_patterns": ["*.sublime-workspace"]
@kuronekomichael
kuronekomichael / Preferences.sublime-settings
Last active December 22, 2015 04:48
tern_for_sublimeのtern_argument_hints設定例
{
〜(略)〜
"tern_argument_hints": true
〜(略)〜
}