Skip to content

Instantly share code, notes, and snippets.

View moto2002's full-sized avatar
🌴
On vacation

Jack moto2002

🌴
On vacation
  • NetEase
  • Guangzhou
View GitHub Profile
@lzubiaur
lzubiaur / notification.lua
Last active March 24, 2018 12:34
Lua Notification Center (cocos2dx)
--[[
Why this package?
Cocos2d-x CCNotificationCenter is limited to one lua function callback (observer) per target (CCObject).
This simple Lua script wraps CCNotificationCenter and allows code like:
addObserver(foo,'eventname')
addObserver(foo2,'eventname')
]]--
-- The NotificationCenter (nc) table
local nc = {
@moto2002
moto2002 / rAF.js
Created April 22, 2014 06:22 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
/**
* requestAnimationFrame polyfill by Erik Möller & Paul Irish et. al.
* https://gist.github.com/1866474
*
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/
* http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
**/
/*jshint asi: false, browser: true, curly: true, eqeqeq: true, forin: false, newcap: true, noempty: true, strict: true, undef: true */
// Updated requestAnimationFrame polyfill that uses new high-resolution timestamp
//
// References:
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// https://gist.github.com/1579671
// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision
//
// Note: this is my initial stab at it, *requires additional testing*
(function () {
@touilleMan
touilleMan / SimpleHTTPServerWithUpload.py
Last active May 4, 2024 01:08 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@suakig
suakig / PostBuildProcess.cs
Last active August 23, 2021 15:20
PostBuildProcess.cs
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;
using System.Collections.Generic;
public class PostBuildProcess : MonoBehaviour
{
internal static void CopyAndReplaceDirectory(string srcPath, string dstPath)
@ArturoNereu
ArturoNereu / UI-Fast-Default
Created April 8, 2016 18:12
A simpler version of the UI Shader for mobile and low spec devices
Shader "UI/Fast-Default"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
}
SubShader
{
@sanukin39
sanukin39 / XcodeSettingsPostProcesser.cs
Last active October 11, 2023 16:04
Unity XcodeAPI Settings Sample
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.iOS.Xcode;
using UnityEditor.Callbacks;
using System.Collections;
public class XcodeSettingsPostProcesser
{
@slembcke
slembcke / CustomProjection.cs
Last active February 7, 2024 11:03
Custom projections for Unity2D games.
using UnityEngine;
using System.Collections;
// This script is meant to be attached to your main camera.
// If you want to use it on more than one camera at a time, it will require
// modifcations due to the Camera.on* delegates in OnEnable()/OnDisable().
[ExecuteInEditMode]
public class CustomProjection : MonoBehaviour {
private void OnEnable(){