Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cellfusion
cellfusion / gist:ae6c210067705000959d7ef423d36771
Created April 26, 2016 19:26
UE4でコマンドラインからテスト実行
"PATH\UE4Editor-Cmd.exe" "PATH\[PROJECT_NAME].uproject" -ExecCmds="Automation RunTests [TEST NAME]" -unattended -nopause -testexit="Automation Test Queue Empty" -log -game
@cellfusion
cellfusion / gist:5f6bcd911f2ec9924a26
Created March 11, 2015 06:53
ImageMagick で複数の png を alpha 付きの状態でグレースケール化
mogrify -transparent white -colorspace gray *.png
@cellfusion
cellfusion / gist:d57860a63a9b61b54362
Created December 17, 2014 05:51
iOS と Android でマップを開く時のコード(Google Map を優先)
# iframe で URL scheme を開く
iframe = $('<iframe>').css('display', 'none').attr('src', 'comgooglemaps://?q='+lat+','+lng+'&z='+zoom).appendTo('body')
start = Date.now()
# URL scheme の反応がない場合にこちらで開く
# 通常だとアプリがない場合は iOS はダイアログがでるがこのコードだとダイアログを回避して iOS Map で開くことができる
setTimeout ()->
diff = Date.now() - start
if diff < 2000
# だめだった場合に Map で開く
#----------------------------------------------------------------------
# コマンドラインでのipaと.dSYMファイルの作成
#----------------------------------------------------------------------
# .dSYMのPATH設定
TARGET_DSYM=$WORKSPACE/iOS/build/[App Name].app.dSYM
# Zip出力する.dSYMファイルのPATH設定
DSYM_ZIP_PATH=$WORKSPACE/iOS/build/[App Name].ipa.dSYM.zip
# xcodeプロジェクトパス
using UnityEngine;
using UnityEditor;
using System.Collections;
public class BatchBuild
{
static string bundleIdentifier = "jp.cellfusion.HogeHoge";
// シーンを Editor の設定から取り出す
private static string[] GetScenes ()
@cellfusion
cellfusion / 0_reuse_code.js
Created May 22, 2014 01:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cellfusion
cellfusion / gist:9777976
Created March 26, 2014 06:51
Unity でスクリーンショットを撮って画像を表示
// Screenshot を撮る
Application.CaptureScreenshot("screenshot.png");
// プラットフォームごとに保存位置変わる?
string path = "";
switch (Application.platform) {
case RuntimePlatform.IPhonePlayer:
path = Application.persistentDataPath + "/screenshot.png";
break;
case RuntimePlatform.Android:
@cellfusion
cellfusion / gist:5604605
Created May 18, 2013 14:32
CoreData 使ってユニークキーもどきを NSManagedObject.valideateForInsert 内で判断してみた
- (BOOL)validateForInsert:(NSError **)error {
NSLog(@"validateForInsert:%@", self.id);
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Hoge"];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K = %@", @"id", self.id];
[fetchRequest setPredicate:predicate];
NSArray *results = [self.managedObjectContext executeFetchRequest:fetchRequest error:nil];
if (results.count > 0) {
@cellfusion
cellfusion / CinderProjectApp.cpp
Last active December 14, 2015 18:29
Cinder0.8.5 で Orientations 対応する方法
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class CinderProjectApp : public AppNative {
public:
void setup();
@cellfusion
cellfusion / gist:3985724
Created October 31, 2012 07:57
Cinema4D Goz name reset script
import c4d
from c4d import documents
# C4D select Objects GoZ Data Reset
GoZ_CONTAINER_ID = 2000000
def main():
doc = documents.GetActiveDocument()
objs = doc.GetSelection()