Skip to content

Instantly share code, notes, and snippets.

View kidapu's full-sized avatar
:octocat:
On vacation

kidapu kidapu

:octocat:
On vacation
  • 07:52 (UTC +09:00)
View GitHub Profile
i
me
my
myself
we
our
ours
ourselves
you
your
@satoruhiga
satoruhiga / Spherical coordinate
Created September 25, 2012 11:42
cartesianToSpherical / sphericalToCartesian
ofVec3f cartesianToSpherical(const ofVec3f &v)
{
float r = v.length();
float s = acos(v.z / r);
float f = atan2(v.y, v.x);
return ofVec3f(r, s, f);
}
ofVec3f sphericalToCartesian(const ofVec3f &v)
{
@keijiro
keijiro / ScreenRecorder.cs
Last active January 26, 2022 05:01
Screen recording utility.
using UnityEngine;
using System.Collections;
public class ScreenRecorder : MonoBehaviour
{
public int framerate = 30;
public int superSize;
public bool autoRecord;
int frameCount;
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@mculp
mculp / voices.txt
Created December 3, 2014 00:14
List of voices available by the `say` command on OS X
Agnes en_US # Isn't it nice to have a computer that will talk to you?
Albert en_US # I have a frog in my throat. No, I mean a real frog!
Alex en_US # Most people recognize me by my voice.
Alice it_IT # Salve, mi chiamo Alice e sono una voce italiana.
Alva sv_SE # Hej, jag heter Alva. Jag är en svensk röst.
Amelie fr_CA # Bonjour, je m’appelle Amelie. Je suis une voix canadienne.
Anna de_DE # Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
Bad News en_US # The light you see at the end of the tunnel is the headlamp of a fast approaching train.
Bahh en_US # Do not pull the wool over my eyes.
Bells en_US # Time flies when you are having fun.
@kjunichi
kjunichi / how2curlFileUpload.md
Last active October 12, 2016 20:31
curlコマンドでファイルをアップロードするには

はじめに

Dockerのコンテナ内で作ったファイルを急にホストに持っていきたくなった時

curl

curl -F hoge=@/path/to/file http://ホストのIPアドレス:ポート番号/path
@atinfinity
atinfinity / build_framework.py
Last active November 4, 2015 10:05
OpenCV 3.0-beta Mac OS X向けframeworkビルド用スクリプト(Mac OS X/Xcode/x86_64)
#!/usr/bin/env python
"""
The script builds OpenCV.framework for iOS.
The built framework is universal, it can be used to build app and run it on either iOS simulator or real device.
Usage:
./build_framework.py <outputdir>
By cmake conventions (and especially if you work with OpenCV repository),
the output dir should not be a subdirectory of OpenCV source tree.
@matsuyoro
matsuyoro / gist:c53d82017b2763633e5b
Last active June 1, 2021 13:00
GAS(google app script)で指定ラベルのGmailをslackに通知
// slackのwebhook URL
var postUrl = "https://hooks.slack.com/services/xxxxxxxxxxx";
// 通知したいslackのチャネル(部屋)
var postChannel = "#n_app_review";
// 抽出元のGmailのラベル
var checkLabel = "TO_ME";
function myFunction() {
@ykst
ykst / gist:6e80e3566bd6b9d63d19
Last active February 2, 2024 07:49
WebAudio+WebSocketでブラウザへの音声リアルタイムストリーミングを実装する

WebAudio+WebSocketでブラウザへの音声リアルタイムストリーミングを実装する

WebRTCでやれよ!と言われそうなところですが、 WebSocket+WebAudioの組み合わせで音声ストリーミングをシンプルに構成する方法を紹介してみます。

サーバーサイド(Node.js + ws + pcm)

サーバーサイドは何でも良いのですが、 とりあえずNode.jsでtest.mp3というサンプルファイルをpcmモジュールでデコードし、 wsでクライアントに垂れ流す作りにしておきます。

@cjddmut
cjddmut / EasingFunctions.cs
Last active May 3, 2024 13:31
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights