Skip to content

Instantly share code, notes, and snippets.

View hokuma's full-sized avatar
🎯
Focusing

hokuma hokuma

🎯
Focusing
View GitHub Profile
@hokuma
hokuma / file0.txt
Created October 6, 2012 02:52
Gebでページ操作を定義する ref: http://qiita.com/items/a8164a5f2eb7249a8e97
class ExamplePage extends Page {
static content = {
userId { $("form").find("input", name: "userId") }
userIdErr { $("span#userIdErr").text() }
}
}
@hokuma
hokuma / file0.txt
Created February 25, 2013 12:58
テストコードと依存するライブラリをjarにまとめてCLIで実行する ref: http://qiita.com/items/e489d02f9622ce73b235
<build>
...
<plugins>
...
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>make-assembly</id>
@hokuma
hokuma / file0.php
Created August 24, 2013 04:43
メディア選択時に自分の投稿写真だけ表示する ref: http://qiita.com/halhide/items/35cb62ba3107ac19f4db
add_action( "pre_get_posts", "set_ajax_media_query" );
function set_ajax_media_query( $wp_query ) {
global $current_user;
if( $wp_query ->query_vars['post_type'] != "attachment" ) {
return;
}
get_currentuserinfo();
@hokuma
hokuma / file0.php
Created August 26, 2013 13:21
wordpressのURLカスタマイズ ref: http://qiita.com/halhide/items/9a1ac15164edb92991a9
add_rewrite_rule('カスタム投稿名/([^/]+)(/([^/]+))?/?$','index.php?カスタム投稿名=$matches[1]&xxxpage=$matches[3]','top');
@hokuma
hokuma / file0.php
Created September 15, 2013 14:57
自分が投稿したものだけ管理画面で表示する ref: http://qiita.com/halhide/items/8c85d4ea8f8584721aeb
$views = apply_filters( 'views_' . $this->screen->id, $views );
@hokuma
hokuma / file0.txt
Created October 23, 2013 13:48
ループバック通信をngrepでキャプチャする ref: http://qiita.com/halhide/items/2728f49555683a8ee446
ngrep -d lo -W byline port 80
@hokuma
hokuma / file0.js
Created October 31, 2013 14:18
jasmineでsinon.fakeServerを使うときに気をつけること ref: http://qiita.com/halhide/items/c27f1831b860145ca2a1
var server = sinon.fakeServer.create();
server.autoRespond = true;
server.respondWith( function( xhr, id ) {
xhr.respond( 200, null, "..." );
} );
spyOn( someObject, "somemethod" );
hogeClient.request( ... );
expect( someObject.somemethod ).toHaveBeenCalled();
@hokuma
hokuma / file0.php
Created November 4, 2013 04:24
dashboardからajaxで何かを更新する ref: http://qiita.com/halhide/items/aa07a103f873ab34cf29
add_action( "wp_ajax_アクション名", "my_action_callback" );
function my_action_callback () {
/** アクションの中身 */
}
@hokuma
hokuma / file0.txt
Last active August 29, 2015 14:07
d3.jsで東京メトロの地下鉄路線図を作成する ref: http://qiita.com/halhide/items/0d4116a11d05c21e6edc
"N03_003" LIKE "%区%"
@hokuma
hokuma / file0.txt
Created October 25, 2014 08:26
東京メトロAPI+vue.js = トイレ検索 ref: http://qiita.com/halhide/items/840645c498ef68142048
%div.container-fluid
%div.row
%div.form-group
%div.col-sm-10
%select.form-control.stations{"v-model" => "selected", "v-on" => "change: onChange(this)"}
%option{"v-repeat" => "stations", "value" => "{{name}}"} {{title}}
%div.row.facilities
%div.inside-gate
%h3 改札内:{{insideCount}}
%div.list-group