Skip to content

Instantly share code, notes, and snippets.

View tkoki's full-sized avatar

Takashi Koki tkoki

  • Tokyo, Japan
View GitHub Profile
@tkoki
tkoki / dump_mobileprovision
Last active December 29, 2015 00:55
mobileprovisionsの中身をplist形式で出力する
security cms -D -i pp.mobileprovision > tmp.plist
@tkoki
tkoki / gist:4bc9ec288d5191696459
Created April 8, 2015 08:41
GCDでの遅延実行パターン
double delayInSeconds = 1.0; // 遅延時間
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
// ここに遅延実行したい処理を記述。
});
@tkoki
tkoki / gist:46133a9278c42ec0f67d
Created June 12, 2015 02:50
javahによるJNIヘッダ生成
javah -classpath bin/classes -d jni jp.co.petworks.filesystemtest.NDKBridge
@tkoki
tkoki / gist:a0df02072d99768e4110
Created June 23, 2015 01:43
javaクラスのメソッドシグネチャの取得方法
javap -s -p java.io.File
@tkoki
tkoki / resignipa.sh
Created November 9, 2015 09:24
既存のipaファイルを別のプロビジョニングプロファイルで署名し直す
#!/bin/bash
IPA="/path/to/original.ipa"
NEWIPA="new_filename.ipa"
PROVISION="/path/to/new.mobileprovision"
CERTIFICATE="Name of certificate: To sign with"
unzip -q "$IPA"
rm -rf Payload/*.app/_CodeSignature
cp "$PROVISION" Payload/*.app/embedded.mobileprovision
codesign -f -s "$CERTIFICATE" Payload/*.app
zip -qr "$NEWIPA" Payload
@tkoki
tkoki / mraacheck.c
Last active December 29, 2015 00:53
Edison上でmraaがちゃんとインストールされているかを確認する
/*
Edison上で
% gcc -lmraa -o mraacheck mraacheck.c
% ./mraacheck
hello mraa
Version: v0.9.0
Running on: Intel Edison
などと表示されればok.
*/
#include "mraa.h"
@tkoki
tkoki / config.fish
Created November 22, 2018 09:03
fishde~/.config/fish/config.fish
set -gx PYENV_ROOT "$HOME/.pyenv"
status --is-interactive; and . (pyenv init - | psub)
@tkoki
tkoki / XcodeProjectUpdater.cs
Last active August 7, 2023 17:12
Unity 2019.3 以降でiOSプロジェクトにAPNS関連のCapabilityを追加する
using System;
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
// Unity 2019.3 でGetUnityTargetNameがdeprecatedになってるので。
public class MyBuildPostprocessor {
[PostProcessBuild]
//
// The Zen Programming Language(tm)
// Copyright (c) 2018-2020 kristopher tate & connectFree Corporation.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//
// This project may be licensed under the terms of the ConnectFree Reference
// Source License (CF-RSL). Corporate and Academic licensing terms are also
// available. Please contact <[email protected]> for details.
//
// Zen, the Zen three-circles logo and The Zen Programming Language are
@tkoki
tkoki / PaintCircleDemo.cpp
Last active July 6, 2020 07:10
三角関数を使わない円のペイント
# include <Siv3D.hpp>
void PaintCircle(int cx, int cy, int r, Color c) {
int x, y;
x = r;
y = 0;
while (x >= y) {
Line(cx + x, cy + y, cx + x, cy - y).draw(1, c);