Skip to content

Instantly share code, notes, and snippets.

View cyocun's full-sized avatar

cyocun cyocun

  • CYOinc / IE3
  • Tokyo,Japan
View GitHub Profile
#!/usr/bin/ruby -Ku
require 'fileutils'
# つかいかた
if ARGV.length == 0
print "[Usage?] $ git_diff [from SHA] [to SHA]\n"
exit(false)
end
@cyocun
cyocun / detecting.js
Last active March 28, 2016 10:59
detect mobile and desktop
(function () {
'use strict';
// http://loopj.com/2010/06/12/simple-way-to-extract-get-params-from-a-javascript-script-tag/
var getParams = function (script_name) {
// Find all script tags
var scripts = document.getElementsByTagName("script");
// Look through them trying to find ourselves
for (var i = 0; i < scripts.length; i++) {
@cyocun
cyocun / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cyocun
cyocun / gulpfile.js
Created February 13, 2015 08:03
bower.jsonからかってにやってくれるアレ。
// これ -> https://www.npmjs.com/package/wiredep
// bower.jsonに変更があったらhtmlの
// <!-- bower:js -->
// <!-- endbower -->
//の中にパスを書き込んでくれる。
// scssならscssの中の下記部分
// // bower:scss
// // endbower
gulp.task('wiredep', function () {
var wiredep = require('wiredep').stream;
@cyocun
cyocun / gulpfile
Created January 28, 2015 14:40
gulp sprite
// load Node.js API
var fs = require('fs'),
path = require('path');
// function.getFolders
var getFolders = function (dir) {
return fs.readdirSync(dir)
.filter(function (file) {
return fs.statSync(path.join(dir, file)).isDirectory();
});