Skip to content

Instantly share code, notes, and snippets.

@KAMEDAkyosuke
KAMEDAkyosuke / env.txt
Last active August 29, 2015 14:15
xcode env
COPY_PHASE_STRIP=NO
JAVA_ZIP_FLAGS=-urg
SDK_PRODUCT_BUILD_VERSION=12B411
HEADERMAP_INCLUDES_PROJECT_HEADERS=YES
EXECUTABLES_FOLDER_PATH=cocospadtest.app/Executables
LOCAL_APPS_DIR=/Applications
ENABLE_STRICT_OBJC_MSGSEND=YES
REMOVE_CVS_FROM_RESOURCES=YES
SED=/usr/bin/sed
SYSTEM_DEVELOPER_UTILITIES_DIR=/Applications/Xcode6.x.app/Contents/Developer/Applications/Utilities
package main
import "log"
import "reflect"
func Apply(f interface{}, args []interface{}) interface{}{
fv := reflect.ValueOf(f)
if fv.Kind() != reflect.Func {
log.Fatal("error")
}
@KAMEDAkyosuke
KAMEDAkyosuke / log.h
Created December 22, 2011 05:43
log util for android and others
#ifndef LOG_H
#define LOG_H
#ifdef ANDROID
# include <android/log.h>
# ifndef ANDROID_LOG_TAG
# ANDROID_LOG_TAG "NATIVE_LOG"
# endif /* ANDROID_LOG_TAG */
# ifndef ANDROID_LOG_LEVEL
@KAMEDAkyosuke
KAMEDAkyosuke / concat_libs.sh
Created December 22, 2011 05:54
concatenate static libraries for iOS device and simulator
#!/bin/sh
LIBNAME=$1
mkdir -p usr/local/lib
lipo -create \
armv6/usr/local/lib/$1.a \
armv7/usr/local/lib/$1.a \
i386/usr/local/lib/$1.a \
@KAMEDAkyosuke
KAMEDAkyosuke / make_clone.sh
Created December 22, 2011 05:57
clone vmware image for `VMWare Fusion 3.x`
#!/bin/sh
SOURCE=$1
CLONE=$2
PREFIX='.vmwarevm'
cp -rf $SOURCE $CLONE
cd $CLONE
SOURCE=$(echo $SOURCE | sed -e s/\\$PREFIX//)
public static final void cleanupView(final ViewGroup viewGroup, final View view) {
if(view != null){
view.setBackgroundDrawable(null);
if(view instanceof ImageView) {
ImageView v = (ImageView)view;
v.setImageDrawable(null);
}
else if(view instanceof ImageButton) {
ImageButton v = (ImageButton)view;
v.setImageDrawable(null);
@KAMEDAkyosuke
KAMEDAkyosuke / gist:5697303
Created June 3, 2013 10:19
これで書けば http-sync を普通に node モジュールっぽく使える。
#!/bin/sh
mkdir node_modules
cd node_modules
git clone https://github.com/dhruvbird/http-sync.git
cd http-sync
node-gyp configure
node-gyp build
cp build/Release/curllib.node .
@KAMEDAkyosuke
KAMEDAkyosuke / gist:7577678
Last active December 28, 2015 23:19
AAC のハードウェアエンコーダーをサポートしているかどうかのチェック。
- (BOOL)isAACHardwareEncoderAvailable
{
OSStatus status;
UInt32 size;;
UInt32 encoderSpecifier = kAudioFormatMPEG4AAC;
status = AudioFormatGetPropertyInfo(kAudioFormatProperty_Encoders,
sizeof(encoderSpecifier),
&encoderSpecifier,
&size);
check_osstatus(status, @"AudioFormatGetPropertyInfo fail");
@KAMEDAkyosuke
KAMEDAkyosuke / find-grep NS_AVAILABLE_IOS(10_3.sh
Last active March 29, 2017 03:08
find . -type f -exec grep -B 10 -nH -e ios\(10.3 {} +
$ find . -type f -exec grep -B 10 -nH -e NS_AVAILABLE_IOS\(10_3 {} +
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-577-AVF_EXPORT NSString *const AVAudioSessionInterruptionOptionKey NS_AVAILABLE_IOS(6_0);
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-578-
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-579- /* Only present in begin interruption events, where the interruption is a direct result of the application being suspended
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-580- by the operating sytem. Value is a boolean NSNumber, where a true value indicates that the interruption is the result
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-581- of the application being suspended, rather than being interrupted by another audio session.
./AVFoundation.framework/Frameworks/AVFAudio.framework/Headers/AVAudioSession.h-582-
./AVFoundation.framework/
;; -*- coding:utf-8; mode:emacs-lisp; lexical-binding: t -*-
(require 'cl)
(defconst ragnarok-process "ragnarok-process")
(defvar ragnarok-service-port 1743)
(defun ragnarok-process-filter (process string)
"外部プロセスからのデータ取得"
(message "%s : %s" (process-name process) string))