Skip to content

Instantly share code, notes, and snippets.

View litefeel's full-sized avatar
🎯
I may be slow to respond.

Xiaoqing Zhang litefeel

🎯
I may be slow to respond.
View GitHub Profile
local a = {}
local Plus = {}
local Base = {}
-- t not self
Plus.__index = function (t, k)
-- output Plus true false false
print("Plus", t == a, t == Plus, t == Base)
return Plus[k]
end
-- t not self
@litefeel
litefeel / getkeyhash.bat
Created November 26, 2015 08:24
get key hash from keystore file
# get key hash from keystore file
# first
SET KEY_TOOL=%JAVA_HOME%/bin/keytool.exe
SET OPEN_SSL=%openssl%
SET ALIAS=androiddebugkey
SET KEY_STORE="C:/Users/myuser/.android/debug.keystore"
#keytool -exportcert -alias androiddebugkey -keystore "C:/Users/xiaoqing.zhang/.android/debug.keystore" | openssl sha1 -binary |openssl base64
%KEY_TOOL% -exportcert -alias %ALIAS% -keystore %KEY_STORE% | %OPEN_SSL% sha1 -binary | %OPEN_SSL% base64
@litefeel
litefeel / AndroidManifast.xml
Created November 26, 2015 05:10
Supporting incoming links to your app
<!-- ATTENTION: This intent was auto-generated. Follow instructions at
https://g.co/AppIndexing/AndroidStudio to publish your Android app deep links. -->
<!-- support multiple inter filter -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- http://litefeel.com/myapp/xxxx
visite this link in browse will switch to this application
# .gitconfig or .git/config
# git proxy via socks5
[http]
proxy = socks5://127.0.0.1:3390
apply plugin: 'com.android.application'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
// compile sdk
compile project(':sdks:sdk1')
compile project(':sdks:sdk2')
}
android {
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
@litefeel
litefeel / masker.cpp
Last active August 29, 2015 14:23
masker by blendFunc
// 使用混合做遮罩
CCSize size = m_pMask->getContentSize();
CCRenderTexture *renderTexture = CCRenderTexture::create(size.width, size.height);
// 设置默认颜色
renderTexture->setClearColor(ccc4f(0, 0, 0, 0));
// 设置清除颜色标记,否则autoDraw时不能清除颜色
renderTexture->setClearFlags(GL_COLOR_BUFFER_BIT);
ccBlendFunc func = { GL_ZERO, GL_SRC_ALPHA };
m_pMask->setBlendFunc(func);
#!/usr/bin/python
# coding=utf-8
import os, os.path
import gzip, zipfile
print zipfile.is_zipfile("test.zip")
f = zipfile.ZipFile("test.zip")
@litefeel
litefeel / urlencode.cpp
Last active January 19, 2024 16:50
c++ urlencode
// http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/package.html#encodeURIComponent()
void hexchar(unsigned char c, unsigned char &hex1, unsigned char &hex2)
{
hex1 = c / 16;
hex2 = c % 16;
hex1 += hex1 <= 9 ? '0' : 'a' - 10;
hex2 += hex2 <= 9 ? '0' : 'a' - 10;