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
console.log('hoge'); | |
Promise.resolve() | |
.then(function() { | |
return new Promise(function(resolve) { | |
setTimeout(function() { | |
resolve('fuga'); | |
}, 1000); | |
}); | |
}) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title></title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.26.0/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.26.0/mapbox-gl.css' rel='stylesheet' /> | |
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' /> | |
<style> |
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
<?php | |
class ReadLineIterator implements Iterator { | |
private $fp; | |
private $currentId = 0; | |
private $current = null; | |
public function __construct($fp) { | |
$this->fp = $fp; |
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
<!DOCTYPE html> | |
<html> | |
<head lang="ja"> | |
<meta charset="UTF-8"> | |
<style> | |
body { | |
margin: 0; | |
overflow: hidden; | |
} | |
#images { |
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
#in .gnupg/gpg.conf | |
group mykeys = [recipient1] [recipient2] ... |
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
module Hoge ( | |
fuga | |
) where | |
filter' :: (a -> Bool) -> [a] -> [a] | |
filter' _ [] = [] | |
filter' p (x:xs) = (if p x then (x:) else id) $ filter' p xs | |
chain :: (Integral a) => a -> [a] | |
chain 1 = [1] |
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
TestCase("hoge", { | |
'test for native method': function() { | |
var f = console.log; | |
//f("hoge"); //Illegal Invocation | |
f.bind(console)("hoge"); | |
}, | |
//Native method では Illegal Invocation Error と表示されるが、 | |
//理屈は通常オブジェクトの場合と同じ | |
'test': function() { | |
var obj = { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Bootstrap 101 Template</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
</head> | |
<body> | |
<form id="form"> | |
Select file to add to database: <input type="file" name="file"> | |
<button type="submit">put into db</button> |
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
#include <stdio.h> | |
int main(int argc, char** argv) { | |
//関数定義の前に関数利用のコードがあるとコンパイルエラー. | |
hoge(); | |
} | |
void hoge() { | |
puts("hoge"); | |
} |
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
TestCase("usage.sinon", { | |
'test mock for constructor': sinon.test(function() { | |
var obj = { | |
hoge: function(id) { | |
this.id = id | |
} | |
}; | |
this.mock(obj) |