This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var btnEl = document.getElementById('btn'); | |
btnEl.addEventListener('click', function(e) { | |
var target = e.currentTarget; | |
//btnElに指定したイベントをremove | |
target.removeEventListener('click', arguments.callee, false); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Convert(number, fromUnit) { | |
var conversions = { | |
distance : { | |
meters : 1, | |
cm : 0.01, | |
feet : 0.3048, | |
in : 0.0254, | |
yards : 0.9144 | |
}, | |
volume : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var target = 'hoge'; | |
var search = 'og'; | |
if(target.indexOf(search) != -1) { | |
console.log('部分一致'); | |
} else { | |
console.log('部分一致ではない'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$routeProvider. | |
when('/hoge', { | |
templateUrl: 'hoge.html', | |
controller: 'HogeCtrl', | |
controllerAs: 'ctrl', | |
resolve: { | |
data: [function(){ | |
// ここで色々書く | |
}] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gacha module | |
var Gacha = angular.module('gacha', []); | |
var config = function($routeProvider, $injector) { | |
$routeProvider. | |
when('/', { | |
templateUrl: 'templates/gacha/index.html', | |
controller: 'IndexCtrl', | |
controllerAs: 'ctrl', | |
resolve: $injector.get('IndexResolver') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//DOM生成 | |
var ele = document.createElement("div"); | |
ele.id = 'fpsMeter'; | |
ele.style.position = 'fixed'; | |
ele.style.background = 'rgba(0,0,0,.7)'; | |
ele.style.top = '10px'; | |
ele.style.left = '10px'; | |
ele.style.padding = '10px'; | |
ele.style['z-index'] = 99999; | |
ele.style['border-radius'] = '5px'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img/thumbs | |
├── 0001_bird | |
│ ├── l.png | |
│ ├── m.png | |
│ └── s.png | |
├── 0002_dog | |
│ ├── l.png | |
│ ├── m.png | |
│ └── s.png | |
└── 0003_cat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grunt.initConfig({ | |
file_exist: { | |
options: { | |
output: 'reports/log.txt' //Where the log is output. | |
}, | |
your_target: { | |
options: { | |
patterns: ['l.png', 'm.png', 's.png'] | |
}, | |
src: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install -g yo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |