Skip to content

Instantly share code, notes, and snippets.

View shinnn's full-sized avatar
🍉

shinnn shinnn

🍉
View GitHub Profile
@shinnn
shinnn / file0.txt
Last active August 29, 2015 14:03
ファイル削除にはgulpプラグインを使わない ref: http://qiita.com/shinnn/items/bd7ad79526eff37cebd0
var rimraf = require('rimraf');
gulp.task('clean', function (cb) {
rimraf('./dir', cb);
});
gulp.task('build', ['clean'], function() {
// Something
});
'use strict';
var Transform = require('stream').Transform;
var imageSize = require('image-size');
const LIMIT = 128 * 1024;
class ImageSizeStream extends Transform {
constructor () {
super();
@shinnn
shinnn / reserved.text
Created January 17, 2017 10:21
Github reserved usernames
admin
account
help
about
enterprise
join
new
shop
contact
training
def assert_each_text(selector, array_of_text)
array_of_text.map{|text| {text: /^#{Regexp.quote(text)}$/}}.each.with_index(1) do |opt, i|
assert_selector "#{selector}:nth-of-type(#{i})#{i == array_of_text.size ? ':last-of-type' : ''}", opt.merge!(count: 1)
end
end
def assert_each_text(selector, array_of_text)
array_of_text.map{|text| {text: /^#{text}$/, count: 1}}.each.with_index(1) do |opts, i|
assert_selector "#{selector}:nth-of-type(#{i})#{i == array_of_text.size ? ':last-of-type' : ''}", opts
end