This file has been truncated, but you can view the full file.
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
function ScribeTransport(e) { | |
this.SESSION_BUFFER_KEY = "ScribeTransport", this.SCRIBE_API_ENDPOINT = "/i/jot", this.options = {}, e && (this.updateOptions(e), this.registerEventHandlers(e)) | |
} | |
function ClientEvent(e) { | |
this.scribeContext = {}, this.scribeData = {}, this.scribe = function (t, i) { | |
var n = e || window.scribeTransport; | |
if (!n) throw new Error("You must create a global scribeTransport variable or pass one into this constructor."); | |
if (!t || "object" != typeof t || i && "object" != typeof i) throw new Error("Invalid terms or data hash argument when calling ClientEvent.scribe()."); | |
if (this.scribeContext) { |
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 a = {prime: 1}; | |
var b = {nonprime: 2, prime: 3}; | |
var c = {nonprime: 4, prime: 5, hoge: 6}; | |
var d = Object.assign(a, b, c); | |
console.log(a); | |
console.log(b); | |
console.log(c); | |
console.log(d); |
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 cats = { | |
'@@iterator': function () { | |
let names = Object.keys(this), i = 0 | |
return { | |
next: () => i < names.length ? { value: names[i++] } : { done: true } | |
} | |
}, | |
a: 1, | |
b: 2, | |
c: 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
var table = document.querySelectorAll('table')[0]; | |
var links = Array.prototype.map.call(table.querySelectorAll('a'), function(a) {return a.href}); | |
var timer = window.setInterval(function() { | |
document.body.innerHTML = "<img src='"+links[parseInt(Math.random()*links.length)]+"'>"; | |
}, 10000); |
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
create table 学生 (学生番号, 学生名, 都市, 年齢); | |
insert into 学生 values | |
('S1', '山田', '京都', 19), | |
('S2', '鈴木', '大阪', 20), | |
('S3', '小島', '奈良', 22), | |
('S4', '武田', '京都', 18), | |
('S5', '高木', '神戸', 21); | |
create table 科目 (科目番号, 科目名, 先生, 単位数); | |
insert into 科目 values | |
('J1', 'データベース', '田中', 4), |
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
Array.prototype.forEach.call(document.getElementsByTagName('a'), function(i) {i.innerHTML = '<img src="'+i.href+'">'}) |
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
// executed by traceur 0.0.59 | |
// basic | |
[this.a, b] = [1, 2] | |
console.log(this.a, b) // => 1 2 | |
var {a, b: [c], d: d} = {a: 1, b: [2], d: 3} | |
console.log(a, c, d) // => 1 2 3 | |
var [a, , {b: c}, d] = [1, 3, {b: 2}] | |
console.log(a, c, d) // => 1 2 undefined | |
// parameter |
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
// String.raw | |
console.log(`foo\n`) // foo | |
console.log(String.raw`foo\n`) // foo\n | |
console.log(`foo\n`.length) // 4 | |
console.log(String.raw`foo\n`.length) // 5 | |
console.log(String.raw`foo${1+2}`) // foo3 | |
console.log(`\x31`) // 1 | |
console.log(String.raw`\x31`) // \x31 | |
console.log(String.raw({ raw: ["a", "b", "c"] }, 0, 1, 2, 3)) // => a0b1c |
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
// n秒経ったらresolve | |
var delay = function(second) { | |
return new Promise(function(resolve, reject) { | |
setTimeout(function() { | |
resolve(second) | |
}, 1000 * second) | |
}) | |
} | |
delay(2).then(function(n) { | |
console.log(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
var file = $('.file').css({ margin: 0 }) | |
$('body').empty() | |
file.appendTo('body') | |
$('.meta').remove() |