Skip to content

Instantly share code, notes, and snippets.

View miyaoka's full-sized avatar

Masaya Kazama miyaoka

View GitHub Profile
@miyaoka
miyaoka / gist:aa419249ec5d4cd94ce6
Last active August 29, 2015 14:23
transform.childCount to ReactiveProperty
//子オブジェクト数の変更を監視
var childCount =
transform
.ObserveEveryValueChanged (t => t.childCount)
.ToReactiveProperty ();
childCount
.Subscribe(c => hoge);
// transformに子オブジェクトが無い(transform.childCount == 0)状態で開始したとき
<ul class="actor-links">
{% assign post_actor_ids = site.posts | map: 'actor_ids' | join: ',' | split: ',' | sort %}
{% assign actor_and_count = '' | split: '.' %}
{% for actor in site.actors %}
{% assign count = 0 %}
{% for post_actor_id in post_actor_ids %}
{% if actor.actor_id == post_actor_id %}
{% assign count = count | plus: 1 %}
rawPosts: [
{% for post in site.posts %}
{% capture desc %}{% include post_description.inc post=post %}{% endcapture %}
{
"url": {{ post.url | jsonify }},
"title": {{ post.title | jsonify }},
"actors": [
{% for actor_id in post.actor_ids %}
{
{% assign actor = site.actors | where:"actor_id", actor_id | first %}
<div class="post-count">
<span class="post-count__filtered">[[posts.length]]</span>
/
<span class="post-count__raw">[[rawPosts.length]]</span>
</div>
const app = new Vue({
el: '#episode-list',
delimiters: ['[[', ']]'], // Avoid to conflict to Jekyll template
components: {
@miyaoka
miyaoka / bookmarklet.js
Last active January 15, 2018 09:51
Set playbackRate on hearthis.at
;(function() {
const sm = window.soundManager
const soundId = sm.soundIDs[0]
const playBackward = -15
const askPlaybackRate = () => {
console.log(sm.getSoundById(soundId))
sm.setPlaybackRate(
soundId,
window.prompt('set playbackRate', sm.getSoundById(soundId).playbackRate || 1) || 1
@miyaoka
miyaoka / bookmarklet.js
Created January 17, 2018 05:06
Add extra player controls on Hearthis.at
;(function() {
const sm = window.soundManager
const soundId = sm.soundIDs[0]
if (!soundId) {
alert('No sound found.')
return
}
if (document.querySelector('.ext')) return
@miyaoka
miyaoka / timer.js
Last active May 15, 2018 00:03
presentation timer
let sec = 60 * 8
const alertSec = 60
let timer
let alertTimer
const d = document.createElement('div')
const pad = (s) => `00${s}`.slice(-2)
const update = () => {
d.innerText = `${pad(Math.floor(sec / 60))} : ${pad(sec % 60)}`
}
const stop = () => {
@miyaoka
miyaoka / timer
Last active April 24, 2019 11:11
let sec = 60 * 20
const alertSec = 60
let timer
let alertTimer
const d = document.createElement('div')
const pad = (s) => `00${s}`.slice(-2)
const update = () => {
d.innerText = `${pad(Math.floor(sec / 60))}:${pad(sec % 60)}`
}
const stop = () => {
@miyaoka
miyaoka / gist:0b761dfede84e54abb20d460b5737e38
Last active June 1, 2020 09:37
校長先生の話エンドレス
校長先生の話エンドレス
経過時間
01 : 06 : 37
校長先生音量:
おはようございます。今日は皆さんが、首を長くして待っていた全校遠足の日です。天気も、昨日までと違って、きれいな青空が広がっています。きっと、皆さんの、楽しみにしている気持ちが空に通じたのだと思います。
例えば、お餅に角があったら、みんな記念日に数えていくとよいでしょう。
ああ、怒っていただきました。今日はアメリカの話です。だから。
給食の歴史を経て、鬼のスーパー大松。ということですね。
先生方も、皆さんは、この地球上には道はないのです。文章はこの中学校生活の中で、自分探しの旅、中学校時代につくるのではないのです。今でこそ当たり前になっているものです。
@miyaoka
miyaoka / gist:c302f80a7ccfa7a0b0a7f9ca134e2e14
Last active June 29, 2021 13:15
TL上のTwitter画像をフル表示するstyle
a[role="link"]:not([rel]):not([aria-label]):only-of-type > [style] * {
position: relative !important;
padding-bottom: 0 !important;
margin: 0 !important;
}
a[role="link"]:not([rel]):not([aria-label]):only-of-type > [style] img {
opacity: 1 !important;
}