Skip to content

Instantly share code, notes, and snippets.

View erinlin's full-sized avatar

YuShan Lin (Erin) erinlin

View GitHub Profile
@erinlin
erinlin / objective-c.md
Created December 17, 2013 07:45
Objective-C學習筆記

Objective-C note

初始化 function

-(id) 就是 Objective-C 中的 object, 本身就是帶一個 pointer 所以不用再加 *

-(id)initWithName:(NNString *)name andAge:(int)age{
    id result = [super init];
    if(result){
        self.name = name;

self.age = age;

-- 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 = {}
@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
-- 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 / 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 \
@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 / 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 / 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 / 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 / mdutil.md
Created September 16, 2015 15:11
osx mdutil

#Disable index

$sudo mdutil -i off / 

#Enable index

$sudo mdutil -i on /