Skip to content

Instantly share code, notes, and snippets.

View thorikawa's full-sized avatar

Takahiro "Poly" Horikawa thorikawa

View GitHub Profile
@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
@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:
@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

#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 / 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
@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');
}
}
});
@staltz
staltz / introrx.md
Last active December 1, 2025 11:31
The introduction to Reactive Programming you've been missing
@gatlingxyz
gatlingxyz / gist:52fb21eb92181716b0ce
Created July 11, 2014 23:49
Unofficial Base WatchFace Activity
import android.app.Activity;
import android.content.Context;
import android.hardware.display.DisplayManager;
import android.os.Bundle;
import android.view.Display;
/**
* A base activity for watch faces that have callbacks for the various screen states (dim, awake, and off)
* as well as a callback for when the watch face is removed.
* <p/>
@justmoon
justmoon / custom-error.js
Last active November 19, 2024 02:40 — forked from subfuzion/error.md
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);
@3v1n0
3v1n0 / gpControl.json
Last active November 2, 2020 22:05
GoPro Hero4 Remote tools
{
"version":2.0,
"display_hints":[
{
"key":"GPCAMERA_GROUP_VIDEO",
"display_name":"Video Settings",
"settings":[
{
"setting_id":5,
"widget_type":"select",