Skip to content

Instantly share code, notes, and snippets.

@young40
young40 / .vimrc
Last active December 14, 2015 01:18
My Vim Config for OS X, Vim 7.3
syntax on " 自动语法高亮
"set transparency=20 " 设置背景透明度
set nocompatible " 关闭vi兼容模式
set confirm " 处理未保存或只读文件弹出确认
set number " 显示行号
set nobackup " 不生成临时文件
set noswapfile
set ignorecase " 搜索不区分大小写
set smartcase " 搜索时当关键词有大写时保持大小写敏感
#! /usr/bin/python
Content = open("ui.ccs").read()
ContentArray = Content.split("\n")
newContent = ""
Skip = False
@young40
young40 / emacs-lua-mode-comment
Created July 6, 2015 07:58
Emacs lua-mode comment
local audioEngine = cc.SimpleAudioEngine:getInstance( )
BattleEffect = BattleEffect or { }
--[[ 士气 ]]
function BattleEffect:playMorale( )
end
@young40
young40 / tab2space.lua
Created March 30, 2017 02:38
replace tab with 4 space
local function tab2space(filename)
local lines = {}
io.input(filename)
for line in io.lines() do
table.insert(lines, line)
end
local newLine = {}
for _, line in ipairs(lines) do
@young40
young40 / build2dxprebuild.sh
Created March 30, 2017 02:41
Build cocos2d-x pre-build static lib for cocos2d-x lua iOS
echo "Build start"
mkdir -p frameworks/cocos2d-x-prebuild
cd frameworks/cocos2d-x/build/
rm -rf build
xcodebuild -project cocos2d_libs.xcodeproj -target "libcocos2d iOS"
cd -
cp "frameworks/cocos2d-x/build/build/Release-iphoneos/libcocos2d iOS.a" frameworks/cocos2d-x-prebuild/
cd frameworks/cocos2d-x/cocos/scripting/lua-bindings/proj.ios_mac/
@young40
young40 / item2_open_file_in_emacs.sh
Created January 3, 2019 11:05
open file in Emacs or open it diectly
#!/bin/bash
# exec &> ~/logfile.txt
# In iTerm2 Session preferences <Advanced> pane setup Semantic History to:
#
# [Run coprocess...]
# ~/dot/item2_open_file_in_emacs.sh +\2 \1
if [[ $1 == "+" ]]; then
@young40
young40 / pre-commit
Created May 9, 2019 05:02
luacheck in git hooks
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import subprocess
def cmdGitDiffFiles():
fileList = []
@young40
young40 / .luacheckrc
Created May 11, 2019 09:05
luacheck config file for cocos2d-x Lua
-- -*- lua -*-
exclude_files = {
"src/cocos/*",
}
globals = {
-- for cocos
"cc",
"ccui",
@young40
young40 / CanvasMesh.cs
Last active February 24, 2021 03:41 — forked from EddieCameron/CanvasMesh.cs
Unity script for rendering a mesh inside the canvas UI.
/**
* ============================================================================
* MIT License
*
* Copyright (c) 2017 Eric Phillips
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,