Skip to content

Instantly share code, notes, and snippets.

View mamboer's full-sized avatar

Levin Van mamboer

View GitHub Profile
// UTF8 Module
//
// Cleaner and modularized utf-8 encoding and decoding library for javascript.
//
// copyright: MIT
// author: Nijiko Yonskai, @nijikokun, nijikokun@gmail.com
(function (name, definition, context, dependencies) {
if (typeof context['module'] !== 'undefined' && context['module']['exports']) { if (dependencies && context['require']) { for (var i = 0; i < dependencies.length; i++) context[dependencies[i]] = context['require'](dependencies[i]); } context['module']['exports'] = definition.apply(context); }
else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) { define(name, (dependencies || []), definition); }
else { context[name] = definition.apply(context); }
@mamboer
mamboer / Learning-Android
Created October 14, 2014 02:45
My Android App development merterials
android studio
1. http://code.tutsplus.com/tutorials/getting-started-with-android-studio--mobile-22958
tab navigation
1. http://www.101apps.co.za/articles/tab-navigation-tutorial.html
2. http://www.codeproject.com/Articles/678093/Fragments-Creating-a-Tabbed-Android-User-Interface
@mamboer
mamboer / Learning-Swift
Last active August 29, 2015 14:06
My IOS App development merterials
1. http://www.raywenderlich.com/74438/swift-tutorial-a-quick-start (免费,一个计算器app)
2. http://ios-blog.co.uk/tutorials/developing-ios-apps-using-swift-part-1/
原版本:http://jamesonquave.com/blog/developing-ios-apps-using-swift-tutorial-part-2/
http://jamesonquave.com/blog/tutorials/
### 使用TabBarController
1. http://makeapppie.com/2014/09/09/swift-swift-using-tab-bar-controllers-in-swift/
### 使用cocoapods
1. http://happy-coding.org/swift-and-cocoapods/
@mamboer
mamboer / git-update-in-mac
Last active August 29, 2015 14:06
Update mac's git using Homebrew
### Firstly
Install git via homebrew
```
brew --version
brew doctor
brew install git
```
@mamboer
mamboer / gist:a776a112ab277d7c852f
Created August 14, 2014 09:24
vim-chinese-support
"修改.vimrc文件,设置fileencodings
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
  1. Download SourceGear DiffMerge: http://sourcegear.com/diffmerge/index.html

  2. Add the following to your global .gitconfig file:

     [diff]
         tool = DiffMerge
     [difftool "DiffMerge"]
         cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' "$LOCAL" "$REMOTE"
     [merge]
    

tool = DiffMerge

@mamboer
mamboer / svn-ignore-pattern
Created July 9, 2014 02:30
svn ignore pattern
*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp *[Bb]in *obj *suo *resharp* *.user *.tmp *.TMP *Resharper* *ReSharper* *.Load *.gpState *.NoLoad *.~m2 *.dbmdl *.gpState _notes *.cache [Tt]est[Rr]esult [Bb]uild[Ll]og.* *.[Pp]ublish.xml *.[Cc]ache [Tt]humbs.db lint.db *.docstates .apdisk [Ll]ogs .DS_Store
## .gitconfig
[alias]
dt = difftool
mt = mergetool
[diff]
tool = bc3
[difftool]
prompt = false
[difftool "bc3"]
@mamboer
mamboer / xhogan-demo.js
Last active August 29, 2015 14:02
API of xhogan.js
/**
* 将指定数据渲染指定模板
* @param {Object} opts 配置对象
* @param {String} opts.target 渲染目标的css选择器,例如#test
* @param {String} opts.tpl 模板的id选择器或者模板的内容(支持远程模板文件例如http://faso.me/xhogan/tpl/test.html)。如果是模板id,需要以#开始,例如#tpl1
* @param {String} opts.data 渲染模板所需数据,json对象或者远程json文件例如http://faso.me/xhogan/data/test.json
* @param {String} opts.tplVersion 模板版本号
* @param {String} opts.dataVersion 数据版本号
* @param {String} opts.appendToTarget 是否将最后的dom追加到目标元素中
* @param {Object} opts.extraTplData 模板渲染的额外数据
@mamboer
mamboer / sgz-misc.json
Last active August 29, 2015 14:02
newslist data dictionary for sgz.qq.com app
/* 首页分类+快捷入口+百宝箱数据 */
{
//首页分类
"cates":[
{
"id":"分类ID",
"name":"分类名称"
}
],
//快捷入口 - 更多