Skip to content

Instantly share code, notes, and snippets.

View oosugi20's full-sized avatar

Makoto OOSUGI oosugi20

View GitHub Profile
@oosugi20
oosugi20 / Gruntfile.coffee
Created August 11, 2015 05:22
汎用 Gruntfile
module.exports = (grunt) ->
# package.jsonをロード
config =
pkg: grunt.file.readJSON('package.json')
# Gruntプラグインをロード
Object.keys(config.pkg.devDependencies).forEach (key) ->
if /^grunt-/.test(key)
@oosugi20
oosugi20 / .vimrc.zen-conding
Last active December 28, 2015 20:39
past setting for zen-coding
" zen-codingの設定
let g:user_zen_expandabbr_key = '<D-Return>'
let g:user_zen_next_key = '<D-C-,>'
let g:user_zen_prev_key = '<D-C-;>'
let g:user_zen_settings = {
\ 'html': {
\ 'indentation': '',
\ 'empty_element_suffix': '>',
\ 'snippets': {
@oosugi20
oosugi20 / Gruntfile.coffee
Last active December 24, 2015 15:29
grunt-watch でコンパイルした後にブラウザを自動リロード
module.exports = (grunt) ->
grunt.task.loadNpmTasks 'grunt-shell'
shell:
reload:
command: 'osascript -e \'tell application "Google Chrome" to reload active tab of window 1\''
# apply in watch task
@oosugi20
oosugi20 / gist:4043590
Created November 9, 2012 03:52
Shaffle the staffs
Array.prototype.shuffle = function() {
   var i = this.length;
   while(i){
       var j = Math.floor(Math.random()*i);
       var t = this[--i];
       this[i] = this[j];
       this[j] = t;
   }
   return this;
}
@oosugi20
oosugi20 / gist:2042720
Created March 15, 2012 07:25
UserAgentから判別して振り分けする
/**
* MY.device
* UserAgentから判別してデバイスを振り分けるためのメソッド
*/
MY.device = (function () {
var _ua = window.navigator.userAgent;
var ua, type;
// iPhone || iPod
@oosugi20
oosugi20 / gist:2042711
Created March 15, 2012 07:22
スマホの縦横検出
/**
* orientation
* デバイスの向きに合わせてhtml要素にclassを付与
* * 縦:orientationV
* * 横:orientationH
*/
var orientation = (function () {
var $window, $body;
var orientation = {
@oosugi20
oosugi20 / wget.sh
Created February 19, 2012 00:48
URLリストからファイル(画像やCSSも含めて)をダウンロードする
#!/bin/sh
for i in "http://www.example.com/index.html" "http://www.example.com/hoge/hoge.html"
do
wget -p -nc -nv $i
done
var MYAPPNAME = MYAPPNAME || {};
MYAPPNAME.ui = MYAPPNEAME.ui || {};
MYAPPNAME.util = MYAPPNAME.util || {};
(function (MY, UI, UTIL, $, window, undefined) {
})(MYAPPNAME, MYAPPNAME.ui, MYAPPNAME.util, jQuery, this);
@oosugi20
oosugi20 / gist:1569953
Created January 6, 2012 10:06
ターミナルで文字コードが違うやつのパスを出力
for f in `find ./ -name *.htm*`;
do
if test `nkf -g $f` != 'Shift_JIS';
then
echo $f;
fi
done
body {
background-color: #FFC;
}