Skip to content

Instantly share code, notes, and snippets.

@cnsoft
cnsoft / networkpeer_RPC.cs
Last active December 28, 2015 04:59
How networkpeer handle RPC (from Photon Unity SDK) .
/// RPC Hashtable Structure
/// (byte)0 -> (int) ViewId (combined from actorNr and actor-unique-id)
/// (byte)1 -> (short) prefix (level)
/// (byte)2 -> (int) server timestamp
/// (byte)3 -> (string) methodname
/// (byte)4 -> (object[]) parameters
/// (byte)5 -> (byte) method shortcut (alternative to name)
///
/// This is sent as event (code: 200) which will contain a sender (origin of this RPC).
@cnsoft
cnsoft / Console.cs
Created November 11, 2013 14:25 — forked from mminer/Console.cs
using UnityEngine;
using System;
using System.Collections.Generic;
/// <summary>
/// A console that displays the contents of Unity's debug log.
/// </summary>
/// <remarks>
/// Developed by Matthew Miner (www.matthewminer.com)
/// Permission is given to use this script however you please with absolutely no restrictions.
@cnsoft
cnsoft / nginx.conf
Created October 29, 2013 07:32 — forked from vessi/nginx.conf
# available in /etc/nginx/nginx.conf
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
}
//Almost same with my PyEvent
//
// main.m
// CTest
//
// Created by TSEnel on 13-5-4.
// Copyright (c) 2013年 TSEnel. All rights reserved.
//
#include <iostream>
#include <string>
@cnsoft
cnsoft / ipin.py
Created October 5, 2013 03:14 — forked from urielka/ipin.py
#---
# iPIN - iPhone PNG Images Normalizer v1.0
# Copyright (C) 2007
#
# Author:
# Axel E. Brzostowski
# http://www.axelbrz.com.ar/
# axelbrz@gmail.com
#
# References:
@cnsoft
cnsoft / copyrst.py
Last active December 21, 2015 20:29
#This uitls can copy srt file to destination folder. when i download Lynda.com - iOS SDK Essential Training (2012)
#!/usr/bin/env python
#coding=utf-8
#This uitls can copy srt file to destination folder.
#you should install python runtime first. python.2.6 is prefered.
# @Atuthor cnsoft 2012-10-05 midnight
import os
import os.path
import shutil
@cnsoft
cnsoft / gist:6355326
Last active December 21, 2015 19:38
jenkins ios continuous build
https://wiki.jenkins-ci.org/display/JENKINS/Xcode+Plugin
https://github.com/SICSoftwareGmbH/sicci_for_xcode/issues/5
https://wiki.jenkins-ci.org/display/JENKINS/Plugins#Plugins-iOSdevelopment
https://github.com/jenkinsci/testflight-plugin
@cnsoft
cnsoft / xingqiba.py
Created August 27, 2013 07:20
weiyouxi.api python
http://xingqibawiki.sinaapp.com/index.php/Python-category#test
#test
import web
import api
urls = (
'/', 'index'
)
class index:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
1.CentOS 6.3
#yum install make gcc
#cd /opt
$wget http://redis.googlecode.com/files/redis-2.x.xx.tar.gz
$tar zxf redis-2.x.xx.tar.gz
$cd redis-2.x.xx
$make
$make install
//////