Skip to content

Instantly share code, notes, and snippets.

View yaeda's full-sized avatar

Takeshi Yaeda yaeda

View GitHub Profile
@yaeda
yaeda / wav2mp3
Created July 8, 2022 14:08
wav2mp3
ffmpeg -i some.wav -vn -ac 2 -ar 44100 -ab 256k -acodec libmp3lame -f mp3 some.mp3
import { ContactShadows, Environment } from '@react-three/drei'
import { useThree } from '@react-three/fiber'
import * as React from 'react'
import * as THREE from 'three'
const presets = {
rembrandt: {
main: [1, 2, 1],
fill: [-2, -0.5, -2],
},
@yaeda
yaeda / useSTL.js
Last active February 8, 2022 04:27
useSTL
const useSTL = (path) => {
return useLoader(STLLoader, path)
}
useSTL.preload = (path) => useLoader.preload(STLLoader, path)
useSTL.clear = (input) => useLoader.clear(STLLoader, input)
const ModelSTL = () => {
const stl = useSTL(stlPath)
@yaeda
yaeda / disconnect.js
Created September 13, 2019 09:21
utility modules for toio.js
module.exports = function(cube) {
return new Promise((resolve, reject) => {
cube.peripheral.disconnect(error => {
if (error !== null) {
reject(error)
} else {
resolve()
}
})
})
@yaeda
yaeda / case1__with_namespace.ts
Last active May 17, 2017 03:23
Why I want to introduce namespace
class SomeDevice {
constructor(private peripheral: Noble.Peripheral) {
}
public connect(): void {
this.peripheral.connect();
}
public disconnect(): void {
this.peripheral.disconnect();
@yaeda
yaeda / gist:29f57464de51363ae0c9
Created January 16, 2015 13:49
Android Wear Bluetooth Debug
~/Library/Android/sdk/platform-tools/adb forward tcp:4444 localabstract:/adb-hub
~/Library/Android/sdk/platform-tools/adb connect localhost:4444
@yaeda
yaeda / AssetBundleSample.cs
Created April 18, 2013 07:30
Unity AssetBundle Examples.
using System;
using UnityEngine;
using System.Collections;
public class AssetBundleSample : MonoBehaviour {
public GUIText guitext;
// Use this for initialization
void Start () {
@yaeda
yaeda / gist:4490894
Last active December 10, 2015 20:48
知識データベースを作りたい

知識データベースシステムについて調べる. とりあえず使ってみて調査.他にも候補があれば教えてください.

Gist

  • markdownのリアルタイムPreview欲しい,,と思ったけど工夫されてた。これはこれでありだな.

Qiita->

@yaeda
yaeda / gist:4490414
Created January 9, 2013 03:55
Rubyでecho無しに標準入力させる方法
# < 1.9.3
print "type PASSWORD : "
system "stty -echo"
password = gets.chop
system "stty echo"
# > 1.9.3
require 'io/console'
print "type PASSWORD : "
password = STDIN.noecho(&:gets).chop