Skip to content

Instantly share code, notes, and snippets.

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

rainbow23 rainbow23

🏠
Working from home
View GitHub Profile
-(void) registerAdmob
{
NSLog(@"-> registerAdmob initializing Admob start");
UnityViewController* controller = (UnityViewController*)UnityGetGLViewController();
EAGLView* view = (EAGLView*)[controller view];
NSLog(@"EAGLView frame size:(%f, %f)", view.frame.size.width, view.frame.size.height);
CGFloat scaleSize = [UIScreen mainScreen].scale;
NSLog(@"UIScreen scale:%f", scaleSize);
CGFloat screenWidth = view.frame.size.height * scaleSize;
CGFloat bannerWidth = GAD_SIZE_320x50.width;
@rainbow23
rainbow23 / FunctionManager
Created January 21, 2015 15:18
NGUIのUISpriteに貼付ける。FunctionManagerEditor.cs と一緒に使う。
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[RequireComponent(typeof(UISprite))]
public class FunctionManager : MonoBehaviour {
public enum FuncType{
HelpFunc = 0,
OnOffSound,
ShowOsusumeApps,
ShowRanking,
@rainbow23
rainbow23 / FunctionManagerEditor
Created January 21, 2015 15:20
EditorScript : FunctionManagerのメソッドを一つだけ選ぶ仕組み。
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
[CustomEditor(typeof(FunctionManager))]
[CanEditMultipleObjects]
public class FunctionManagerEditor : Editor {
public override void OnInspectorGUI() {
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class BitmapNumberManager : MonoBehaviour {
private List<NumSettings> numSprites = new List<NumSettings>();
private float firstNumPosX;
private const float initializeOffsetX = 38f;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class NumSettings : MonoBehaviour {
private UISprite sprite;
private UISprite childSprite;
private bool hasChild = false;
public bool activeSelf{private set; get;}
@rainbow23
rainbow23 / AddFrameworkPostProcessBuild
Last active January 20, 2016 06:29
Unity > Xcodeビルド時 pbx, plistを編集できた
using UnityEngine;
using System.Collections;
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
public class AddFrameworkPostProcessBuild : MonoBehaviour {
[PostProcessBuild ]
@rainbow23
rainbow23 / Framework追加 .framework追加 対応 完成
Last active January 22, 2016 14:24
hard coding しているが正常な動きは確認、 provisioning の指定ができなかったのでこれから調べる
using UnityEngine;
using System.Collections;
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
public class AddFrameworkPostProcessBuild : MonoBehaviour {
private static PBXProject m_PBXProject = null;
private static string m_ProjPath = null;
@rainbow23
rainbow23 / gist:fe8e9de108ebd312563b
Last active January 25, 2016 11:17
Library追加だけ実装
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
public class LibrarySettings {
#include <stdio.h>
int main()
{
for(int i =0; i < 4; i++){
printf("num:%d >> %d\n",i, (i>>1)&1);
/* log
00
01
10
@rainbow23
rainbow23 / jenkins-port-forwarding.md
Created May 7, 2017 16:55 — forked from carlossless/jenkins-port-forwarding.md
Port Forwarding (8080 -> 80) with `pf` on Mavericks/Yosemite

Jenkins Port Forwarding (8080 -> 80) with pf on Mavericks/Yosemite

This guide is a fork from this gist. I've added minor adjustments to customise these rules to forward connections from an outsite interface like en0.

Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

1. Create the anchor file

Create an anchor file under /etc/pf.anchors/com.jenkins with your redirection rule like: