Skip to content

Instantly share code, notes, and snippets.

View suisho's full-sized avatar
🚫
Deprecated

Old account suisho

🚫
Deprecated
View GitHub Profile
@suisho
suisho / file0.txt
Last active September 2, 2015 15:05
Browserifyの共通モジュール部分だけ分離したいならfactor-bundleが便利 ref: http://qiita.com/inuscript/items/b933af4d44a4712cb8f8
browserify x.js y.js -p [ factor-bundle -o bundle/x.js -o bundle/y.js ] \
-o bundle/common.js
@suisho
suisho / entry-jquery.js
Last active August 29, 2015 14:28
Browserifyのオプションつけるとどんな出力になるのかを検証する。 ref: http://qiita.com/inuscript/items/1fe19d32011e39ed8e2b
(function e(t, n, r) {
// 省略
})({
1: [function(require, module, exports) {
var $ = require("jquery")
console.log($(".foo"))
}, {
"jquery": undefined
}]
}, {}, [1]);
@suisho
suisho / file0.sh
Created August 21, 2015 00:49
Browserfyの出力をpretty printした状態で吐き出したい ref: http://qiita.com/inuscript/items/dd56f1c397419bfc42ca
$ npm i -D js-beautify
@suisho
suisho / mocha.js
Created August 5, 2015 12:25
mochaで特定バージョンだけスキップしたりしなかったりするテストをする。 ref: http://qiita.com/inuscript/items/7e2ece4e659472811fee
var semver = require("semver")
describe("何らかのテスト", function(){
var itFn = it
if(semver(process.version, ' < 0.12')){
itFn = it.skip
}
itFn("0.12以上ならやるテスト", function(){
// test...
})
@suisho
suisho / circle.yml
Created August 5, 2015 12:20
circle-ciで複数のnode.jsバージョンで検証をしたい ref: http://qiita.com/inuscript/items/f5dd5eacb10085d15ff7
machine:
node:
version: 0.12.0
dependencies:
pre:
- if [ $CIRCLE_NODE_INDEX == "1" ] ; then nvm alias default iojs-v1.3.0 ; fi
test:
override:
@suisho
suisho / file0.css
Last active August 29, 2015 14:23
SCSSと付き合う上でやって(知って)よかったこと8選 ref: http://qiita.com/inuscript/items/e996c42798bbb17add13
div {
-webkit-box-shadow: 0px 0px 10px rgba(255,0,0,.5);
-moz-box-shadow: 0px 0px 10px rgba(255,0,0,.5);
box-shadow: 0px 0px 10px rgba(255,0,0,.5);
}
@suisho
suisho / SassMeister-input.scss
Created June 25, 2015 16:12
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.3)
// ----
@mixin border-title($color: "black"){
border: 1px dotted #{$color};
color: #{$color}
}
@suisho
suisho / SassMeister-input.scss
Created June 25, 2015 08:56
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.3)
// ----
.message-box{
.fuga{
.jast-hoge-hoge &
{
color :red;
@suisho
suisho / Chart.jsx
Created June 13, 2015 04:15
Reactから外部のライブラリを直接使う ref: http://qiita.com/suisho/items/c55db2700111acb298f6
class Chart extends React.Component{
constructor(){
super()
this.chartClassName = "chart"
this.renderer = new ChartistRenderer()
}
componentDidMount(){
this.renderChart()
}
componentDidUpdate(){
@suisho
suisho / bad-case.js
Created June 4, 2015 13:54
gulpポリスに怒られないタスクの書き方:自動bowerインストール編 ref: http://qiita.com/suisho/items/92c8cbf557597e3b3f49
gulp.task('install', function(cb){
gulp.src(["./bower.json"])
.pipe(install())
.on('finish', function(){
cb();
});
});
});