Skip to content

Instantly share code, notes, and snippets.

View seiji's full-sized avatar
🏠
Working from home

Seiji Toyama seiji

🏠
Working from home
View GitHub Profile
@seiji
seiji / AndroidManifest.xml
Last active December 21, 2015 00:08
Receive ringermode changed
<receiver android:name="me.seiji.AudioReceiver" >
<intent-filter>
<action android:name="android.media.AUDIO_BECOMING_NOISY" />
<action android:name="android.media.RINGER_MODE_CHANGED" />
</intent-filter>
</receiver>
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
一般的にはデフォルトの設定である
"Don't Create Position Independent Executables"NO
"Generate Position-Dependent Code", NO
であればPIE Binaryでビルドされるようです。
またiOS Deployment TargetiOS4.3未満(Xcode4.5未満)にした場合は上記の設定が効かない
> otool -vh test.app/Test
http://stackoverflow.com/questions/16455416/non-pie-binary-the-executable-project-name-is-not-a-position-independent-e/16457732#16457732
@seiji
seiji / gist:5419104
Created April 19, 2013 09:07
Run GHUnit iOS Simulator 6.x
int main(int argc, char *argv[])
{
@autoreleasepool {
CFMessagePortCreateLocal(NULL, (CFStringRef) @"PurpleWorkspacePort", NULL, NULL, NULL);
return UIApplicationMain(argc, argv, nil, @"GHUnitIOSAppDelegate");
}
}
@implementation UIWindow (Private)
if [ "${CONFIGURATION}" = "Release" ]; then
echo Do something really release-like
fi
@seiji
seiji / gist:4481012
Created January 8, 2013 03:50
whatismyIP
curl http://ifconfig.me
curl http://ifconfig.me/ip
@seiji
seiji / gist:4173637
Created November 30, 2012 03:38
runningProcesses
#include <sys/sysctl.h>
- (NSArray *)runningProcesses {
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0};
size_t miblen = 4;
size_t size;
int st = sysctl(mib, miblen, NULL, &size, NULL, 0);
@seiji
seiji / gist:4167028
Created November 29, 2012 05:38
usleep.c
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
if (argc <= 1)
usleep(1);
else
usleep(atol(argv[1]));
return 0;
}
@seiji
seiji / gist:4166563
Created November 29, 2012 03:16
raise memorywarning
[[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning)];