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 / list.js
Created June 1, 2015 01:31
1時間以内に解けなければプログラマ失格となってしまう5つの問題が話題に Five programming problems every Software Engineer should be able to solve in less than 1 hour http://www.softantenna.com/wp/software/5-programming-problems/
// http://www.softantenna.com/wp/software/5-programming-problems/
var assert = require('assert');
//(1) forループ、whileループ、および再帰を使用して、リスト内の数字の合計を計算する3つの関数を記述せよ。
(function() {
function forSum(inputs) {
var sum = 0;
for (var i = 0; i < inputs.length; i++) {
sum += inputs[i];
@kuronekomichael
kuronekomichael / pre-commit
Last active May 5, 2018 11:36
user.nameやuser.emailが設定されていない時は、git commitを失敗させるフック
#!/bin/sh
# 一時フォルダの場合は特に制限を入れない
if [[ $PWD =~ ^/private/var/folders/ ]] ; then
exit 0
fi
if [ -z "`git config --local user.name`" ]; then
echo "\033[31m ✗ FATAL: user.name is not set locally \033[0m"
echo "\033[35mgit config user.name {your-name}\033[0m"
#include "TrinketFakeUsbSerial.h"
void setup()
{
TFUSerial.begin();
}
void loop()
{
TFUSerial.task(); // this should be called at least once every 10 ms
require 'selenium-webdriver'
require 'eyes_selenium'
require 'rubygems'
eyes = Applitools::Eyes.new
# This is your api key, make sure you use it in all your tests.
eyes.api_key = 'LZaId14atU1nIA1MQIWqPwNQvWiskKuweYAx66D1rCQ110(仮)'
# Setup appium - Ensure the capabilities meets your environment.
# Refer to http://appium.io documentation if required.
@kuronekomichael
kuronekomichael / _helper.js
Last active August 29, 2015 14:02
mocha/chaiでテストを書くときにいつものセット(mocha.opts, _helper.js)
global.expect = require('chai').expect;
global.sinon = require('sinon').expect;
// clear console
process.stdout.write('\u001b[2J\u001b[0;0H');
#!/bin/bash
# [usage]
# instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]
# --- 環境設定
APP_NAME=<TargetAppName>
# for 7.0.3-64
#SIMULATOR_VERSION=7.0.3-64
#GUID=9BAC4C3E-BBC2-4805-A115-A310CB21A941
@kuronekomichael
kuronekomichael / uiautomation_js_reference.md
Last active November 27, 2015 09:14
UIAutomation JavaScript Reference

UIAutomation JavaScript Reference 日本語版

based on UIAutomationRef.pdf

Accessing and Using User Interface Elements

エレメントは階層構造になっている UIATarget.localTarget()を最上位とする

@kuronekomichael
kuronekomichael / 0_reuse_code.js
Created December 21, 2013 06:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kuronekomichael
kuronekomichael / migrate_selenium4.js
Created December 13, 2013 10:17
Selenium RCからWebDriverに移行するための、シンプルな4つの手順
selenium.getEval(
"selenium.isElementPresent('id=foo') && " +
"selenium.isVisible('id=foo')");
@kuronekomichael
kuronekomichael / migrate_selenium3.js
Created December 13, 2013 10:16
Selenium RCからWebDriverに移行するための、シンプルな4つの手順
// 良くない例:<body>の中のテキストを全て取得して検証している
String text = selenium.getBodyText();
assertTrue(text.contains("hello"));
WebElement body = webdriver.findElement(
By.tagName("body"));
String text = body.getText();
assertTrue(text.contains("hello"));