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"/> | |
<script src="//static.opentok.com/v2/js/opentok.min.js"></script> | |
<style> | |
.preview { | |
width: 640px; | |
height: 360px; | |
margin: 5px; |
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
const ( | |
MinAspectRatioConstraint = MediaConstraintKey("minAspectRatio") | |
MaxAspectRatioConstraint = MediaConstraintKey("maxAspectRatio") | |
MaxWidthConstraint = MediaConstraintKey("maxWidth") | |
MinWidthConstraint = MediaConstraintKey("minWidth") | |
MaxHeightConstraint = MediaConstraintKey("maxHeight") | |
MinHeightConstraint = MediaConstraintKey("minHeight") | |
MaxFrameRateConstraint = MediaConstraintKey("maxFrameRate") | |
MinFrameRateConstraint = MediaConstraintKey("minFrameRate") |
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
chrome.tabs.onCreated.addListener(function (tab) { | |
console.log('onCreated', tab); | |
}); | |
chrome.tabs.onUpdated.addListener(function (tabId, inf) { | |
console.log('onUpdated', tabId, JSON.stringify(inf)); | |
}); | |
chrome.tabs.onMoved.addListener(function (tabId, inf) { | |
console.log('onMoved', tabId, JSON.stringify(inf)); | |
}); | |
chrome.tabs.onSelectionChanged.addListener(function (tabId, inf) { |
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 () { | |
'use strict'; | |
var ChromeSocketsXMLHttpRequest = chrome.sockets.tcp.xhr = function () { | |
Object.defineProperties(this, { | |
options: { | |
enumerable: false, | |
writable: true, | |
value: { | |
uri: null, |
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
** | |
* Module Design Pattern | |
* Import and Export | |
*/ | |
MODULE = (function ($) { | |
var my = {}; | |
var privateVariable = 'jQuery version '; | |
function privateMethod() { | |
// ... |
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>DOM THETA S</title> | |
.theta-camera{ | |
width:140px; | |
position:relative; | |
} | |
.theta-camera *{ |
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
nohupコマンド | |
$ nohup node app.js & | |
最後の&はバックグラウンドで実行するというオプション。 |
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>fabric Cubic Bezier</title> | |
<script src="fabric.js"></script> | |
</head> | |
<body> | |
<canvas id="c" width="600" height="500"></canvas> | |
<script> |
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
/* | |
// オブジェクトのキーを62進数に変換 | |
createKeydic(obj); | |
keyShorten(obj); | |
// オブジェクトのキーを62進数から元に戻す | |
restoreKey(obj); | |
*/ | |
var keydic = {}; |
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 zen = '。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワンガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポヷヴヺ'.split(''); | |
var han = '。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワンガギグゲゴザジズゼゾダヂヅデドバパビピブプベペボポヷヴヺ'.split(''); | |
var dicZtoH = {}; | |
var dicHtoZ = {}; | |
var gai = zen.indexOf('ガ'); | |
zen.forEach(function (o, i) { | |
var hi = i < gai ? i : gai + ((i - gai) * 2); | |
dicZtoH[o] = i < gai ? han[hi] : han[hi] + han[hi + 1]; | |
dicHtoZ[dicZtoH[o]] = o; |