Skip to content

Instantly share code, notes, and snippets.

View tanshio's full-sized avatar
🤢
😭

Shota Tanno tanshio

🤢
😭
View GitHub Profile
@tanshio
tanshio / clipboardToForm
Created June 1, 2014 06:23
clipboard to form
document.body.onpaste=function(e){
var pasteText;
pasteText = e.clipboardData.getData("text/plain");
pasteText = pasteText.replace("console","");//text replace
document.getElementById("").value = pasteText;
};
@tanshio
tanshio / download_csv.js
Created June 14, 2014 16:09
download adwords and sponserd search report by spookyjs
"use strict";
// user settings
var G_ID = "google_id",
G_PASS = "google_pass",
Y_ID = "y_id",
Y_PASS = "y_pass";
// wait setting
@tanshio
tanshio / gulp_20140618.js
Created June 18, 2014 04:33
gulp_20140618.js
'use strict';
// generated on 2014-06-18 using generator-gulp-webapp 0.1.0
var gulp = require('gulp');
// load plugins
var $ = require('gulp-load-plugins')();
gulp.task('styles', function () {
return gulp.src('app/styles/main.scss')
@tanshio
tanshio / resize.js
Last active August 29, 2015 14:03
Tune up resize events
var queue;
window.addEventListener('resize', function() {
clearTimeout( queue );
queue = setTimeout(function() {
setResize();
}, 250 );

Setup Mac OS X

I'm in a hospital in Spain and my MacBook was stolen.

Hospital Commit

Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.

1. Run Software Update

@tanshio
tanshio / easing.js
Created July 7, 2014 05:30 — forked from gre/easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@tanshio
tanshio / shaffle.js
Created July 10, 2014 02:16
Fisher–Yates
shaffle = function(arr){
var n = arr.length;
for(var i = n - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
}
var y = window.scrollY || document.body.scrollTop || document.documentElement.scrollTop
@tanshio
tanshio / deepcopy.js
Last active August 29, 2015 14:04
json.parse
shop = {};
shop.chara ={
'elmo':{
'name':'えるも',
'item':'あいす',
'itemList':{
'ice':{
'name':'アイス',
@tanshio
tanshio / sample.js
Created July 15, 2014 19:48
deepcopy-sample-1
shop = {};
shop.chara ={
'elmo':{
'name':'えるも',
'item':'あいす',
'itemList':{
'ice':{
'name':'アイス',