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
# 参考: ネイティブ JSON を使う | |
# (https://developer.mozilla.org/ja/docs/Using_native_JSON#replacer_.E3.83.91.E3.83.A9.E3.83.A1.E3.83.BC.E3.82.BF) | |
obj = | |
a: 12 | |
b: 'hoge' | |
c: true | |
d: undefined | |
e: 'fuga' | |
f: [12, 'piyo', true] |
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
print_int (( * ) ((+) 1 2) ((+) 2 3));; |
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
let (+) = ( * ) in Printf.printf "%B" (3 * 5 = 15); |
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
(* Step 4 *) | |
let xy = | |
let x = 'x' and y = 'y' in x :: [y] | |
let ab = | |
let a = 'a' and b = 'B' in a :: [Char.lowercase b] | |
let up = Char.uppercase in | |
let big_xy = List.map up xy and | |
big_ab = List.map up ab in |
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
('A';) (*´ω`*) |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>box-sizing-1</title> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; | |
font-family: Consolas; |
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
typeof (()=>{})(); // => 'undefined' | |
typeof (()=>({}))(); // => 'object' | |
/**/ | |
(()=>this)(); // => Window | |
(()=>this).call(1); // => 1 | |
(()=>((()=>this)())).call(1); // => Window |
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"> | |
<meta name="viewport" content="width=device-width"> | |
<link rel="stylesheet" href="style.css"> | |
<title>index.html</title> | |
</head> | |
<body> | |
<h1>index.html</h1> |
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
/.+/.test('\n'); // => false | |
/[\s\S]+/.test('\n'); // => true | |
'/*hoge\n*/fuga*/'.replace(/\/\*[\s\S]*?\*\//g, ''); // => 'fuga*/' | |
document.body.innerHTML = document.body.innerHTML.replace(/\/\*[\s\S]*?\*\//g, '').replace(/\n{2,}/g, '\n\n'); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main(int argc, char *argv[]) { | |
char *s; | |
int i, n; | |
for (i = 1; i < argc; i++) { | |
n = (strchr(argv[i], ':')) ? strtol(s + 1, (char**) NULL, 10) : 32; | |
srand(strtol(argv[i], (char**) NULL, 10)); | |
for (;n--;) { |