Skip to content

Instantly share code, notes, and snippets.

View thorikawa's full-sized avatar

Takahiro "Poly" Horikawa thorikawa

View GitHub Profile
@staltz
staltz / introrx.md
Last active July 19, 2026 16:25
The introduction to Reactive Programming you've been missing
@thedamon
thedamon / backbutton close bootstrap modal
Created February 28, 2014 17:59
Cause back button to close Bootstrap modal windows
$('div.modal').on('show', function() {
var modal = this;
var hash = modal.id;
window.location.hash = hash;
window.onhashchange = function() {
if (!location.hash){
$(modal).modal('hide');
}
}
});
@zhuowei
zhuowei / enablethatlauncher.sh
Created November 27, 2013 04:22
Enable Google Experience Launcher without an additional APK from the command line
pm enable com.google.android.googlequicksearchbox/com.google.android.launcher.GEL
pm enable com.google.android.googlequicksearchbox/com.android.launcher3.WallpaperCropActivity
pm enable com.google.android.googlequicksearchbox/com.android.launcher3.ToggleWeightWatcher
pm enable com.google.android.googlequicksearchbox/com.android.launcher3.MemoryDumpActivity
pm enable com.google.android.googlequicksearchbox/com.android.launcher3.MemoryTracker
pm enable com.google.android.googlequicksearchbox/com.android.launcher3.PreloadReceiver
pm enable com.google.android.googlequicksearchbox/com.android.launcher3.InstallShortcutReceiver
pm enable com.google.android.googlequicksearchbox/com.android.launcher3.UninstallShortcutReceiver
pm enable com.google.android.googlequicksearchbox/com.android.launcher3.UserInitializeReceiver
pm enable com.google.android.googlequicksearchbox/com.android.launcher3.PackageChangedReceiver
#ifndef COONSCURVE_INCLUDED
#define COONSCURVE_INCLUDED
float3 coons(float t, float3 p0, float3 p1, float3 v0, float3 v1)
{
float3 a = 2*p0 - 2*p1 + v0 + v1;
float3 b = -3*p0 + 3*p1 - 2*v0 - v1;
float t2 = t*t;
float t3 = t2*t;
@zhuowei
zhuowei / notle.md
Last active December 17, 2015 18:39
Random Glass notes

One of the UUIDs used by Glass:

public static final UUID IDENTITY_UUID = UUID.fromString("f96647cf-7f25-4277-843d-f407b4192f8b");

All Glass applications (excluding GlassSystemUI) are built with a bog-standard Android SDK, hence the use of reflection to access hidden APIs and no odexing.

Glass applications use a few Library Projects, as evidenced by the multiple R.java files:

./com/google/glass/home/R.java ./com/google/glass/logging/R.java

@johanneswuerbach
johanneswuerbach / .travis.yml
Last active September 22, 2025 03:17
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@algal
algal / nginx-cors.conf
Created April 29, 2013 10:52
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
@nobonobo
nobonobo / spectrum.py
Created March 25, 2013 13:15
リアルタイムスペクトラム・アナライザーを作ってみた。 PortAudioのPython版PyAudioとnumpyに依存。 実行すると横並び64個の0〜9の数値の表示が流れ続けます。 マイク音声を入力すると周波数成分別に数字が大きくなります。 リアルタイム16Kサンプリングの512点FFTがCore-i5レベルCPU2%程度の使用量で動きます。 内部ではちゃんと周波数の値が計算されています(ループの中で計算する必要はなかった・・・) - 口笛で音階をつけると大きな数字が現れる場所がスライドします。 - 打撃音は全部の数値が増えます。
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
import atexit
import time
import numpy as np
import pyaudio
@karl-
karl- / CleanUpWindow.cs
Created November 15, 2012 03:25
New interface for removing unused Unity assets
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Collections;
using System.Collections.Generic;
public class CleanUpWindow : EditorWindow
{
bool groupEnabled = true;
List<string> usedAssets = new List<string>();
@chrisallick
chrisallick / gist:3990089
Created October 31, 2012 21:42
Autoplay audio on the ipad or iphone using webkitaudiocontext instead of audio tag
AudioSFX = function( _p, _autoplay ) {
var self = this;
var parent = _p;
this.sounds = new Array();
this.context = new webkitAudioContext();
this.autoplay = _autoplay;
this.play = function( sound ) {