Skip to content

Instantly share code, notes, and snippets.

View rogerz's full-sized avatar

Rogerz Zhang rogerz

View GitHub Profile
@rogerz
rogerz / compile.sh
Created September 13, 2011 02:04
sourcenav compiling command under mingw
CFLAGS="-O2 -ffast-math -fomit-frame-pointer -march=i686" ./configure --prefix=/opt/sourcenav --enable-mingw -C
@rogerz
rogerz / winmerge.sh
Created September 16, 2011 01:23
winmerge script for msysGit
#!/bin/sh
# git config --global -e
#
# [diff]
# tool = winmerge
# [difftool "winmerge"]
# cmd = winmerge.sh $LOCAL $REMOTE $BASE
# [difftool]
# prompt = false
NULL="/dev/null"
@rogerz
rogerz / uffs_build_log
Created November 4, 2011 07:12
uffs build log
Building src\uffs\uffs.gpj
Compiling uffs_version.c because uffs_version.o does not exist
Compiling uffs_badblock.c because uffs_badblock.o does not exist
"src\uffs\src\uffs\uffs_badblock.c", line 93: warning #550-D: variable "type"
was set but never used
u8 type;
^
Compiling uffs_blockinfo.c because uffs_blockinfo.o does not exist
@rogerz
rogerz / json.c
Created December 8, 2011 07:23
jansson
// Free jansson object by json_decref()
void cgi_JSON()
{
json_t *pObj = json_pack ("{s:i, s:s}", "foo", 1, "bar", "string");
char *pString = json_dumps(pObj, JSON_INDENT(2));
HttpSend(pString);
free(pString);
json_decref(pObj);
}
@rogerz
rogerz / GDB.sh
Created December 9, 2011 05:53
CheatSheet
gdb --args program arg1 arg2 ...
@rogerz
rogerz / gist:1885309
Created February 22, 2012 14:16
npm issue
local:
cash@0.0.1 /home/rogerz/cash
├─┬ everyauth@0.2.30
│ ├─┬ connect@1.8.5
│ │ ├── formidable@1.0.9
│ │ ├── mime@1.2.5
│ │ └── qs@0.4.2
│ ├── node-swt@0.1.1
│ ├── node-wsfederation@0.1.1
@rogerz
rogerz / run_scanner.c
Created March 8, 2012 11:56
yaml scanner
#include <yaml.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef NDEBUG
#undef NDEBUG
#endif
#include <assert.h>
@rogerz
rogerz / jquery.validator.demo.js
Created June 17, 2012 09:22
jquery validator example
$(function() {
$.validator.addMethod("list", function(value, element, param) {
var isValid = false;
var list = $.parseJSON(param);
$.each(list, function() {
if (value == this) {
isValid = true;
return false;
};
})
@rogerz
rogerz / .gitconfig
Last active July 3, 2018 10:25
git
[alias]
la = log --graph --oneline --decorate --all
lg = log --graph --oneline --decorate --all
@rogerz
rogerz / gist:2988838
Created June 25, 2012 14:04
IE file upload HTTP request
POST / HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://ec2-23-20-227-204.compute-1.amazonaws.com:3000/
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
Content-Type: multipart/form-data; boundary=---------------------------7dcf3a405aa
Accept-Encoding: gzip, deflate
Host: ec2-23-20-227-204.compute-1.amazonaws.com:3000
Content-Length: 18271
Connection: Keep-Alive