Skip to content

Instantly share code, notes, and snippets.

View lexnewgate's full-sized avatar
💭
I may be slow to respond.

lexnewgate lexnewgate

💭
I may be slow to respond.
  • Blackjack
  • Shanghai
View GitHub Profile
@lexnewgate
lexnewgate / numberToBinStr
Created July 29, 2016 07:45
Lua- number to binary string
local function numberToBinStr(x)
ret=""
while x~=1 and x~=0 do
ret=tostring(x%2)..ret
x=math.modf(x/2)
end
ret=tostring(x)..ret
return ret
end
@lexnewgate
lexnewgate / premake5.lua
Created September 25, 2017 10:13
premake_lua5
workspace "lua5"
configurations "Debug"
targetdir "bin/debug"
configurations "Release"
targetdir "bin/release"
language "C"
files {
"src/*.c",
@lexnewgate
lexnewgate / helper.lua
Created July 22, 2018 20:38
helper functions of lua
--helper funcs
function desc(descp,sep,charn)
sep=sep or "-"
charn= charn or 80
charn= (charn>=#descp) and 80 or #descp
leftseps= math.floor((charn-#descp)/2)
rightseps= charn-leftseps-#descp
writeNChar(leftseps,sep)
@lexnewgate
lexnewgate / ProcessHelper.cs
Created December 7, 2018 07:50
UnityProcessHelper
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using Debug = UnityEngine.Debug;
namespace Locality
{
class ProcessHelper
{
public static int RunWinCmd(string cmd)
@lexnewgate
lexnewgate / .gitignore
Created December 21, 2018 07:56
UnityIgnore
**/.vs
**/Library
**/obj
**/bin
@lexnewgate
lexnewgate / README.md
Created February 20, 2019 04:53 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
  1. First you select development build for Android.(Build Settings-> Android -> check Develop Build box)

  2. Here is the guide from Unity doc: https://docs.unity3d.com/Manual/ProfilerWindow.html

  3. Before the 'adb forward' you should check the port(34999) first using: netstat -a -o -n | find "34999"

  4. Kill the process that alreay take the port "34999" using: taskkill /F /PID process_id

  5. adb forward --remove-all