Skip to content

Instantly share code, notes, and snippets.

@rike422
rike422 / gist:8008335
Created December 17, 2013 16:59
titanium用のgruntfail src配下をapp配下に移す想定
module.exports = function(grunt) {
'use strict';
// Grunt Initialize
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
watch : {
all : {
files : [ 'Resources/**/*.js' ],
tasks : [ 'tishadow:spec' ]
},
ユースケース
* 概要を把握する
** 全体的にそのリストからどのような印象を受けるか考える
* 項目を一見ずつブラウズする必要があるか
* 特定の項目を検索する必要があるか
* ソートやフィルタリングを行う必要があるか?
@rike422
rike422 / gist:7096675
Created October 22, 2013 07:48
casper.js使い方

casper.jsとは

CasperJS is an open source navigation scripting & testing utility written in Javascript for the PhantomJS WebKit headless browser and SlimerJS (Gecko). It eases the process of defining a full navigation scenario and provides useful high-level functions, methods & syntactic sugar for doing common tasks such as:

参考資料

コマンド

@rike422
rike422 / gist:5805050
Last active December 18, 2015 15:29
jsでrailsの日付拡張っぽく日付取得するやつ(未テスト)タイムゾーン回り怪しい
Number.prototype.ago = function() {
var result, addSec, gap;
result = new Date();
addSec = this.valueOf() * 86400000;
gap = dt.setTime(Date.now() - addSec);
result.setTime(gap);
return dt;
}
Number.prototype.since = function() {
@rike422
rike422 / gist:5801928
Last active December 18, 2015 15:08
重複検出
function dupulicate(array) {
var storage = {};
var duplicateArray = [];
var i,value;
for ( i=0; i < array.length; i++) {
value = array[i];
if (value in storage) {
duplicateArray.push(value);
} else {
storage[value] = true;