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:
This file contains hidden or 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
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; |
This file contains hidden or 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
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() { |
This file contains hidden or 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
ユースケース | |
* 概要を把握する | |
** 全体的にそのリストからどのような印象を受けるか考える | |
* 項目を一見ずつブラウズする必要があるか | |
* 特定の項目を検索する必要があるか | |
* ソートやフィルタリングを行う必要があるか? | |
This file contains hidden or 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
module.exports = function(grunt) { | |
'use strict'; | |
// Grunt Initialize | |
grunt.initConfig({ | |
pkg : grunt.file.readJSON('package.json'), | |
watch : { | |
all : { | |
files : [ 'Resources/**/*.js' ], | |
tasks : [ 'tishadow:spec' ] | |
}, |
This file contains hidden or 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
echo ' SELECT chat.friendlyname, ms.timestamp, ms.author, ms.body_xml, ms.from_dispname FROM Messages as ms LEFT JOIN Chats as chat ON ms.chatname = chat.name;' | sqlite3 -csv main.db |
This file contains hidden or 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
nandatte = [ | |
"http://suiseinanpa.com/wp-content/uploads/434536.jpg" | |
"https://shuyaout.files.wordpress.com/2014/10/1.gif" | |
"http://shimoinaba.cocolog-nifty.com/photos/uncategorized/2010/12/21/photo.jpg" | |
"http://livedoor.blogimg.jp/nandemoj22/imgs/3/9/3998d2a1.jpg" | |
] | |
module.exports = (robot) -> | |
robot.hear /(だったんだよ)/i, (msg) -> |
This file contains hidden or 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
.body--index, .header--interior { | |
background-image: none; | |
} | |
body { | |
background-color: #846059; | |
} |
This file contains hidden or 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
Array.prototype.sample = function(loop) { | |
var result = [], loop = loop || 1; | |
for(var i = 0; i < loop; i++) { | |
result.push(this[Math.floor(Math.random() * this.length)]); | |
} | |
return result; | |
} |
This file contains hidden or 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
# prefixキーをC-aに変更する | |
set -g prefix C-a | |
# C-bのキーバインドを解除する | |
unbind C-b | |
# キーストロークのディレイを減らす | |
set -sg escape-time 1 | |
# ウィンドウのインデックスを1から始める |
OlderNewer