Skip to content

Instantly share code, notes, and snippets.

View suzuki0keiichi's full-sized avatar

SUZUKI Keiichi suzuki0keiichi

View GitHub Profile
@suzuki0keiichi
suzuki0keiichi / index.html
Created May 4, 2021 14:54
何故か6倍で丁度いい音がなってしまう
<html>
<head>
<meta http-equiv="origin-trial"
content="___"/>
</head>
<body>
<audio id="audio"></audio>
<button onclick="record()">record</button>
<button onclick="play()">play</button>
</body>
@suzuki0keiichi
suzuki0keiichi / こういう呼び方すると良い感じにやってくれる
Last active August 29, 2015 14:10
Scala.jsでfullOptJSすると良い感じにやってくれる件(Vueの宣言は別でしてある)
new Vue(VueInstantiationOptions(el = "#editor", template = "template"))
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@suzuki0keiichi
suzuki0keiichi / gist:a78a8c361f6bb0a52aa9
Created July 13, 2014 10:05
Polymerのcore-listサンプルがdefinePropertyだと動かない件
<!doctype html>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
@suzuki0keiichi
suzuki0keiichi / Simple_Texture2D.js
Created December 26, 2013 15:46
glbook/Chapter_9/Simple_Texture2D/Simple_Texture2DをEmscriptenにかけるとどんな感じになるか。 これ https://github.com/kripken/emscripten/blob/master/tests/glbook/Chapter_9/Simple_Texture2D/Simple_Texture2D.chttps://github.com/kripken/emscripten/blob/master/tests/glbook/Common のものをまとめたやつをEmscriptenにかけた結果。
// Note: Some Emscripten settings will significantly limit the speed of the generated code.
// Note: Some Emscripten settings may limit the speed of the generated code.
// The Module object: Our interface to the outside world. We import
// and export values on it, and do the work to get that through
// closure compiler if necessary. There are various ways Module can be used:
// 1. Not defined. We create it here
// 2. A function parameter, function(Module) { ..generated code.. }
// 3. pre-run appended it, var Module = {}; ..generated code..
// 4. External script tag defines var Module.
// We need to do an eval in order to handle the closure compiler
@suzuki0keiichi
suzuki0keiichi / hello.js
Last active January 1, 2016 10:59
LLVM-IRアセンブリで書いたHello WorldをEmscriptenにかけるとどんな感じになるか。 もちろんhello.llの方をlliに渡してもちゃんとHello Worldが出る。
// Note: Some Emscripten settings will significantly limit the speed of the generated code.
// Note: Some Emscripten settings may limit the speed of the generated code.
// The Module object: Our interface to the outside world. We import
// and export values on it, and do the work to get that through
// closure compiler if necessary. There are various ways Module can be used:
// 1. Not defined. We create it here
// 2. A function parameter, function(Module) { ..generated code.. }
// 3. pre-run appended it, var Module = {}; ..generated code..
// 4. External script tag defines var Module.
// We need to do an eval in order to handle the closure compiler
@suzuki0keiichi
suzuki0keiichi / Scala.jsでパターンマッチの変換結果 2013 7.24現在.js
Last active December 20, 2015 05:29
Scala.jsでパターンマッチがどのように変換されるか
ScalaJS.c.helloworld\ufe33HelloWorld$.prototype.hoge\ufe34O\ufe34V = (function(arg$num) {
var rc6$jsid$17007 = false;
var x2$jsid$17002 = null;
var x1$jsid$17001 = arg$num;
var result$$jslabel$matchEnd7$17008;
// Someはそのままの機能、if文を並べつつ代入&ラベルでbreak(このbreakの機能初めて知った)
$jslabel$matchEnd7$17008: {
if (ScalaJS.is.scala\ufe33Some(x1$jsid$17001)) {
rc6$jsid$17007 = true;
x2$jsid$17002 = ScalaJS.as.scala\ufe33Some(x1$jsid$17001);
@suzuki0keiichi
suzuki0keiichi / Scala.jsでifの最後の評価結果の代入の変換結果 2013 7.24現在.js
Last active December 20, 2015 05:29
Scala.jsでifの最後の評価結果の代入がどのように変換されるか
ScalaJS.c.helloworld\ufe33HelloWorld$.prototype.hoge\ufe34I\ufe34O = (function(arg$num) {
// 宣言時の場合は評価結果の場で宣言される(Javascriptではifブロック内スコープは無いので)
if ((arg$num === 20)) {
var value$jsid$11972 = "hello"
} else {
var value$jsid$11972 = "bye"
};
// 再代入の場合は評価結果の場で代入される
if ((arg$num === 20)) {
value$jsid$11972 = "hello"
@suzuki0keiichi
suzuki0keiichi / Scala.jsでscala.js.Arrayの操作の変換結果 2013 7.24現在.js
Last active December 20, 2015 04:29
Scala.jsでscala.js.Arrayの操作がどのように変換されるか
// def hoge()の中身のみ貼付ける
var array$jsid$11979 = [ScalaJS.modules.scala\ufe33Predef().int2Integer\ufe34I\ufe34Ljava\ufe33lang\ufe33Integer(10), ScalaJS.modules.scala\ufe33Predef().int2Integer\ufe34I\ufe34Ljava\ufe33lang\ufe33Integer(20), ScalaJS.modules.scala\ufe33Predef().int2Integer\ufe34I\ufe34Ljava\ufe33lang\ufe33Integer(30)];
array$jsid$11979[0] = ScalaJS.modules.scala\ufe33Predef().int2Integer\ufe34I\ufe34Ljava\ufe33lang\ufe33Integer(15);
var num$jsid$11980 = ScalaJS.as.java\ufe33lang\ufe33Number(array$jsid$11979[0])