Skip to content

Instantly share code, notes, and snippets.

🤘

itoz itoz

🤘
View GitHub Profile
@itoz
itoz / file0.m
Created Apr 9, 2014
[objc][memo] BundleのJSONを読み込んでNSArrayにする ref: http://qiita.com/itoz/items/62a45eca3d59e0d60ded
View file0.m
//------------------------------
// JSONを読み込む
//------------------------------
NSError *error0 = nil;
NSBundle *bundle = [NSBundle mainBundle];
NSString *path = [bundle pathForResource:@"local" ofType:@"json"];
NSString *jsonString = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error: &error0];
NSData *jsonData = [jsonString dataUsingEncoding:NSUnicodeStringEncoding];
if(error0){NSLog(@"よみこみえらー");}
@itoz
itoz / gist:eea1218ea83f7b4f0733
Created Sep 19, 2014
[objc] ダブルクォートをシングルクォートにし、改行をとる JSにOBJECTテキスト渡すときとかにつかう
View gist:eea1218ea83f7b4f0733
//ダブルクォートをシングルクォートにし、改行をとる
NSStirng * string = @"hogehoge";
string = [string stringByReplacingOccurrencesOfString:@"\"" withString:@"\'"];
string = [string stringByReplacingOccurrencesOfString:@"\n" withString:@""];
@itoz
itoz / gist:854501
Created Mar 4, 2011
[Android] Livewallpaper manifest.xml Template
View gist:854501
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
*============================================================
* copyright(c) 2011 www.romatica.com
* @author itoz
* 2011/03/08
*============================================================
* android wallpaper manifest.xml template.
* アンドロイドライブ壁紙用 マニフェストXML テンプレート
@itoz
itoz / Android LiveWallpaper Template
Created Mar 5, 2011
[Android] LiveWallpaper Template (アンドロイドライブ壁紙テンプレート)
View Android LiveWallpaper Template
/**
*============================================================
* copyright(c) 2011 www.romatica.com
* @author itoz
* 2011/03/05
*============================================================
*/
package ****.****.*****;
import android.content.res.Resources;
@itoz
itoz / gist:856324
Created Mar 5, 2011
[Android] resフォルダ内、ライブ壁紙用XML
View gist:856324
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
*============================================================
* copyright(c) 2011 www.romatica.com
* @author itoz
* 2011/03/05
*============================================================
*/
-->
View gist:856657
// ボタンイベントで配信された状態値が引数に渡される。obj["type"] が各キャラの状態値。
private function search(bit : uint) : Array{
var result : Array = [];
for (var i : int = 0; i < _arr.length; i++) {
var obj : Object = _arr[i];
if ((bit & parseInt(obj["type"], 2)) == bit)
result.push(node);
}
return result;
}
View gist:856659
<sample>
<chara>
<user name="キャラA" type="1010100" />
<user name="キャラB" type="0010100" />
<user name="キャラC" type="0101000" />
<user name="キャラD" type="0011000" />
<user name="キャラE" type="1111111" />
<user name="キャラF" type="0001001" />
<user name="キャラG" type="1000001" />
<user name="キャラH" type="1000010" />
@itoz
itoz / correctExifOrient
Created Mar 24, 2011
Eixf の Orientation(回転情報)から、正の位置に補正したBitmapDataを返す.
View correctExifOrient
/**
* EixfのOrientation(回転情報)から、正の位置に補正したBitmapDataを返す.
* @param bitmapData 補正前のBitmapData
* @param exifOrient exifのOrient情報 1~8
* @see http://sylvana.net/jpegcrop/exif_orientation.html
*/
public static function correctExifOrient(bitmapData : BitmapData, exifOrient : int) : BitmapData
{
var correctBMD : BitmapData;
var mat : Matrix = new Matrix();
View BalloonPanel
/**
*============================================================
* copyright(c) 2011
* @author itoz
* 2011/04/01
*============================================================
*/
package com.romatica.display
{
import caurina.transitions.Tweener;
@itoz
itoz / gist:943928
Created Apr 27, 2011
URLからflashversをswfに渡す
View gist:943928
var flashvars={};
if( location.search != "" ){
var str = location.search.substring( 1 );
var params = str.split( "&" );
for( var i = 0; i < params.length; i++ )
{
var values = params[ i ].split( "=" );
flashvars[ values[ 0 ] ] = values[ 1 ];
}
}
You can’t perform that action at this time.