Skip to content

Instantly share code, notes, and snippets.

View adelzhang's full-sized avatar
🎯
Focusing

Adel Zhang adelzhang

🎯
Focusing
View GitHub Profile
static int UTF16len(unsigned short *utf16)
{
unsigned short * start = utf16;
while(*utf16++) ;
return (int)(utf16 - start - 1);
}
size_t __UTF16toUTF8(const unsigned short utf16char, char* utf8str) {
if (utf16char < 0x80) {
utf8str[0] = (utf16char >> 0 & 0x7F) | 0x00;
@adelzhang
adelzhang / sublime-timestamp.py
Created September 22, 2013 01:16
Sublime Time-stamp
#! python
"""
TextCommand:
insert_timetamp
EventListener:
on_pre_save: update_timestamp
"""
import datetime
import sublime
import sublime_plugin
@adelzhang
adelzhang / .vimrc
Last active August 29, 2015 13:56
dot vim
"be iMproved
set nocompatible
filetype off "required by vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'scrooloose/nerdcommenter'
@adelzhang
adelzhang / signapk.bat
Created September 19, 2014 07:19
sign apk with debug keystore
@echo off
jarsigner -keystore %HOMEPATH%\.android\debug.keystore -storepass android -keypass android -digestalg SHA1 -sigalg MD5withRSA -signedjar %1-signed.apk %1.apk androiddebugkey