Skip to content

Instantly share code, notes, and snippets.

@luxuia
luxuia / obb_md5_computer.cs
Created November 1, 2018 08:45
unity 会记录打出来的obb的hash在/assets/bin/Data/settings.xml 。修改obb或者想复用obb就需要修改apk内的hash字段。 用obb的最后65558个字节计算的hash
public static string CalculateObbDigest(string file)
{
byte[] arrayOfByte = null;
using (var localMessageDigest = MD5.Create())
using (var localFileInputStream = File.OpenRead(file))
{
long l1 = localFileInputStream.Length;
localFileInputStream.Seek(l1 - Math.Min(l1, 65558L), SeekOrigin.Current);
arrayOfByte = localMessageDigest.ComputeHash(localFileInputStream);
local gang = require 'korea_lang'
local week = require 'gangtai_lang'
local diff_tbl = {}
function get_tbl(cfgs)
local tbl = {}
for tag, info in pairs(cfgs.entries) do
diff_tbl[tag] = {}
mkdir ../week_change
cp -rp --parents `git diff --name-only bbbb HEAD` ../week_change/ ----从上次之后的master上的修改
-- 清理目录
cd ../week_change/
rm res_ui -r
rm res_ui2/data/final_data -r
rm res_ui2/ui2.lua
rm res_fx/data/fx3 -r
rm res_fx/meta -r
rm res_fx/fx4.lua -r
@luxuia
luxuia / profiler.lua
Created August 10, 2018 16:18
sample lua profiler
--[[
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php.
Example:
ProFi = require 'ProFi'
ProFi:start()
some_function()
another_function()
coroutine.resume( some_coroutine )
ProFi:stop()
#!/bin/bash
cd ../../
if [ $# == 2 ]
then
mkdir ../$2
cp -rp --parents `git log --grep=$1 --pretty="format:" --name-only | sort | uniq` ../$2
else
git log --grep=$1 --pretty="format:" --name-only | sort | uniq
fi
cp -rp --parents `git diff --name-only 3d352 HEAD` ../gangtai_change/
cp -rp --parents `cat png_diff_list | awk '{print $0}'` ../png_gang
@luxuia
luxuia / lparser.c
Created March 15, 2018 09:14
lua 备忘
//http://www.cnblogs.com/zxh1210603696/category/682573.html
/*
** check whether, in an assignment to an upvalue/local variable, the
** upvalue/local variable is begin used in a previous assignment to a
** table. If so, save original upvalue/local value in a safe place and
** use this safe copy in the previous assignment.
*/
static void check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) {
FuncState *fs = ls->fs;
@luxuia
luxuia / xml_diff.lua
Last active April 16, 2018 11:07
xml_diff
#! /usr/bin/env lua
--1.a git config diff.xml_diff.textconv xml_diff.lua
--1.b editor file: .git/config
---- [diff "xml_diff"]
---- textconv = xml_diff.lua
--2. editor file: .gitattributes
---- *.xml diff=xml_diff