This file contains 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
$ -> | |
$input = $('input') | |
$('button').on 'click', -> | |
$input.val window.pageYOffset # => 現在のscrollY | |
$(window).on 'hashchange', -> | |
$input.val window.pageYOffset # => hashchangeする前のscrollYが返される | |
window.scrollTo 0, 0 |
This file contains 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 request = [ | |
{ url: 'hoge00.json', params: { hoge: 123, huga: 456 } }, | |
{ url: 'hoge01.json', params: { hoge: 246, huga: 912 } }, | |
{ url: 'hoge02.json', params: { hoge: 369, huga: 1368 } }, | |
{ url: 'hoge03.json', params: { hoge: 492, huga: 1824 } }, | |
{ url: 'hoge04.json', params: { hoge: 615, huga: 2280 } } | |
]; | |
var results = []; | |
var doneCount = 0; |
This file contains 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
# ダメなパターン | |
class Foo | |
array: [] | |
object: {} | |
foo = new Foo | |
foo2 = new Foo | |
foo.array.push 'オラァ' |
This file contains 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
interface ICustomEvent { | |
type:string; | |
data:Object; | |
timeStamp:number; | |
defaultPrevented:boolean; | |
} | |
class CustomEvent implements ICustomEvent { | |
data:Object; | |
timeStamp:number; |
This file contains 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
Math.max.apply(null, [-100, 0, 3.14, 0xFF, 1000]); // => 1000 | |
// ※ Mathの関数のコンテキスト(applyやcallの第一引数)はなんでもいいらしい |
This file contains 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
Math.max.apply(null, [-100, 0, 3.14, 0xFF, 1000]); // => 1000 | |
// ※ Mathの関数のコンテキスト(applyやcallの第一引数)はなんでもいいらしい |
This file contains 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
Math.max.apply(null, [-100, 0, 3.14, 0xFF, 1000]); // => 1000 | |
// ※ Mathの関数のコンテキスト(applyやcallの第一引数)はなんでもいいらしい |
This file contains 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<?php $bcBaser->title() ?> | |
<meta name="description" content="<?php echo $bcBaser->getDescription() ?>"> | |
<meta name="keywords" content="<?php echo $bcBaser->getKeywords() ?>"> | |
</head> |
This file contains 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 SIGN_CHARS = '\\u0020-\\u002F\\u003A-\\u0041\\u005B-\\u0061\\u007B-\\u007E'; | |
// 半角数字 | |
var DIGIT_CHARS = '0-9'; | |
// 半角英字 | |
var ALPHA_CHARS = 'A-Za-z'; | |
// [ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~] |
This file contains 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
new SimpleDateFormat("yyyy-MM-dd HH:mm"); |