Skip to content

Instantly share code, notes, and snippets.

View erinlin's full-sized avatar

YuShan Lin (Erin) erinlin

View GitHub Profile
@erinlin
erinlin / SpriteAttacher.cs
Created December 2, 2015 08:25
Unity5.0-Spine-SpriteAttacher Rotation bug fixed
/******************************************************************************
* Spine Runtimes Software License
* Version 2.3
*
* Copyright (c) 2013-2015, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable and
* non-transferable license to use, install, execute and perform the Spine
* Runtimes Software (the "Software") and derivative works solely for personal
@erinlin
erinlin / mdutil.md
Created September 16, 2015 15:11
osx mdutil

#Disable index

$sudo mdutil -i off / 

#Enable index

$sudo mdutil -i on / 
@erinlin
erinlin / gist:454e0e08fa9a9caa863a
Created September 15, 2015 03:32
[TexturePacker] save as RGB4444
find * -name \*.png | sed 's/\.png//g' | \
xargs -I % -n 1 TexturePacker %.png \
--sheet %{v}.png \
--data dummy{v}.plist \
--algorithm Basic \
--allow-free-size \
--max-width 4096 \
--max-height 4096 \
--size-constraints AnySize \
--no-trim \
@erinlin
erinlin / i18n.lua
Last active September 22, 2015 04:19
CoronaSDK-多國語 i18n strings, 整合 Android/iOS 中文繁體與簡體支援
-------------------------------------
-- i18n
-- Copyright (c) 2015 Erin Lin
-- erinylin.com
-- Licensed under the MIT license.
-------------------------------------
--[[
All strings files are under a folder names "locale"
@erinlin
erinlin / FuncDelegate2.lua
Last active August 29, 2015 14:16
[CoronaSDK/Lua] Function Delegate2
-------------------------------------
-- function delegate part 2
-- Author: Erin Lin
-- www.erinylin.com
-- 簡易模擬 C# delegate
-- licensed under the MIT license.
-- 2015, 03
-- 參考:https://gist.github.com/anonymous/3f0e5b046bfdcfa9864a
-------------------------------------
@erinlin
erinlin / FuncDelegate.lua
Last active January 26, 2017 13:29
[CoronaSDK/Lua] Function Delegate
-------------------------------------
-- function delegate
-- Author: Erin Lin
-- www.erinylin.com
-- 簡易模擬 C# delegate
-- licensed under the MIT license.
-- 2015, 02
-------------------------------------
--[[
Usage1:
@erinlin
erinlin / texturepacker-command
Last active August 29, 2015 14:08
TexturePacker: Batch converting images to RGBA4444 for autoSD
find <images folder> -name \*.png | sed 's/\.png//g' | \
xargs -I % -n 1 TexturePacker %.png \
--sheet %{v}.png \
--data dummy{v}.plist \
--algorithm Basic \
--allow-free-size \
--max-width 4096 \
--max-height 4096 \
--size-constraints AnySize \
--no-trim \
-- table library extensions
-- allows the table.copy function to return a shallow copy of a range of the table items
-- Example:
--local t={1,2,3,4,5,6,7,8,9,10}
--dump(table.copy(t,3,8))
--prints out 3,4,5,6,7,8
local table_copy = table.copy
table.copy = function( t, ... )
if (type(arg[1]) == "number" and (arg[2] == nil or type(arg[2]) == "number")) then
@erinlin
erinlin / main.lua
Last active August 29, 2015 13:56
CoronaSDK-moveTo-mulit-screen support
--[[
moveTo function
erinylin.com
for Graphics 2.0
]]--
display.setDefault("background", 1, 1, 1)
function moveTo(object, params)
local T = display.screenOriginY -- Top
-- Project: Dropbox Module
-- Description: A module for accessing Dropbox from Lua/CoronaSDK using the Dropbox REST API. Module written
-- by F. E. Torkel, based off code by Michael Weingarden.
local lfs = require( "lfs" )
local json = require( "json" )
local M = {}