Skip to content

Instantly share code, notes, and snippets.

View xiongjia's full-sized avatar
🤿
Focusing

Xiong-Jia.Le xiongjia

🤿
Focusing
View GitHub Profile
@xiongjia
xiongjia / dictionary.py
Created March 1, 2015 14:51
Online Dictionary API Tests
#!/usr/bin/env python
import os, sys, logging, getopt, ConfigParser, urllib2
class Log(object):
_LEVELS = {
"error": logging.ERROR,
"debug": logging.DEBUG,
"info": logging.INFO
}
@xiongjia
xiongjia / proxy.go
Last active September 14, 2017 07:18 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang #devtools
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@xiongjia
xiongjia / .gitignore
Last active September 14, 2017 07:29
All SQL Joins #db #tips
*.sqlite
*.db
*.log
@xiongjia
xiongjia / LocalRun.cpp
Last active September 14, 2017 07:34 — forked from feuvan/LocalRun.cpp
LocalRun: Run application in specified locale (chs as hard-coded). #devsample #win
/**
* Local(e)Run: Run application in specified locale (chs as hard-coded).
*
* Originial purpose: run fterm.exe in non-Chinese(PRC) locale.
*
* Author: feuvan@feuvan.net
*/
#include <stdio.h>
#include <tchar.h>
@xiongjia
xiongjia / launcher.vbs
Last active September 14, 2017 07:37
This .VBS is created for launch a console application without Window #devsample #win
' This .VBS is created for launch a console application without Window
' Executing Options
Const HIDDEN_WINDOW = 0
Const NORMAL_WINDOW = 1
Const MINIMIZED_WINDOW = 2
Const MAXIMIZE_WINDOW = 3
' Executing arguments.
@xiongjia
xiongjia / pixanim.rb
Last active September 14, 2017 07:39 — forked from ToksT/pixanim.rb
Pixiv download tools #devtools
require 'zip' # install with "gem install rubyzip"
require 'mechanize'
require 'json'
# usage: ruby pixanim.rb ID FORMAT, where ID is the pixiv id number and FORMAT is gif, webm, or apng
# test posts:
# http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44305721
# http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44303110
# http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44353714
# http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44349996
@xiongjia
xiongjia / CMakeLists.txt
Last active September 14, 2017 07:39
OpenGL Tests (GL + GLEW + GLUT + Boost) #devsample #boost #gl
# CMake build script
cmake_minimum_required(VERSION 2.8)
# project name & version
project(GLTest)
# GLEW, GLUT & boost
find_package(GLEW REQUIRED)
find_package(GLUT REQUIRED)
find_package(Boost REQUIRED)
@xiongjia
xiongjia / (README).md
Last active September 14, 2017 07:39
A simple liquibase sample #db

A simple liquibase sample

liquibase (http://www.liquibase.org/ ) is a database Refactor tool. This gist is a simple liquibase sample.

JDBC Driver

  1. Download your Database JDBC Driver. (e.g. SQLite3 JDBC http://www.liquibase.org/sqlite.html )
  2. Add the driver name and .jar file to liquibase command line. (e.g. SQLite3: liquibase --classpath=sqlitejdbc-v<version>.jar --driver=org.sqlite.JDBC )

Database Schema and change log

@xiongjia
xiongjia / (README).md
Last active September 14, 2017 07:40
A simple Bookshelfjs sample #db

A simple Bookshelfjs sample

Bookshelfjs ( http://bookshelfjs.org/ ) is a javascript ORM for Node.js This gist is a simple bookshelfjs sample.

Installation

  1. Clone this gist to a local folder
  2. Run npm run build in the local folder

Configuration

  • This sample read the database config from config.js.
@xiongjia
xiongjia / 0_main.cxx
Last active September 14, 2017 07:40
A simple sample of Boost Pool #devsample #boost
/**
* A simple sample of Boost Pool
*/
#include <iostream>
#include <vector>
#include <boost/pool/pool.hpp>
#include <boost/pool/object_pool.hpp>
#include <boost/pool/singleton_pool.hpp>
#include <boost/pool/pool_alloc.hpp>