Skip to content

Instantly share code, notes, and snippets.

View guange2015's full-sized avatar

gg guange2015

  • usa
View GitHub Profile
@guange2015
guange2015 / gist:9733025
Created March 24, 2014 02:07
icns图标生成
iconutil -c icns "/Users/username/icon.iconset"
icon.iconset是一个文件夹,文件夹里面放以下文件,命名如下,@2x.png是双倍大小的
icon_16x16.png
[email protected]
icon_32x32.png
[email protected]
icon_128x128.png
[email protected]
icon_256x256.png
@guange2015
guange2015 / gist:9500169
Last active August 29, 2015 13:57
Qt5 静态编译如何加载plugin
只讨论qt5, 这里以qt5.2.0 + sqlite3来举例
1. 静态编译时记得把plugin编译进去, 下面的编译选项,可以在configure时查看
` -qt-sql-sqlite -plugin-sql-sqlite `
2. 编译之后察看一下是否编译成功,值得注意的是qt把sqlite3的源码已经带进去了,所以不需要去下sqlite3的源码。
在源码+qtbase/plugins/sqldrivers/ 目录下应该存在.a之类的lib类,我这里是libqsqlite.a
@guange2015
guange2015 / ftpserver.py
Created March 5, 2014 04:20
ftp server
#!/usr/bin/env python2
# coding: utf-8
import os,socket,threading,time
#import traceback
allow_delete = False
local_ip = socket.gethostbyname(socket.gethostname())
local_port = 8888
currdir=os.path.abspath('.')
@guange2015
guange2015 / gist:9346132
Created March 4, 2014 13:03
windows pyqt5 报错,找不到plugins 解决
QT_QPA_PLATFORM_PLUGIN_PATH
D:\Qt\Qt520vs2010glx86\5.2.0\msvc2010_opengl\plugins
@guange2015
guange2015 / qt.bash
Last active August 29, 2015 13:56
qt compile
./configure -prefix $PWD/qtbase -opensource -nomake tests -nomake examples -debug-and-release -static -skip qtwebkit -skip qtquick1 -skip qtquickcontrols -skip qtsvg -skip qtwebkit-examples -skip qtdoc -qt-sql-sqlite -plugin-sql-sqlite -no-glib -no-sql-mysql -confirm-license
@guange2015
guange2015 / mark.c
Created February 4, 2014 13:33
simple gc.
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef enum{
OBJ_INT,
OBJ_PAIR
} ObjectType;
@guange2015
guange2015 / gist:8235323
Created January 3, 2014 09:33
rebuild native gem.
gem pristine --all
@guange2015
guange2015 / gist:7854639
Created December 8, 2013 08:30
mongo备份与导入
mongoexport -d database -c collection -o outputfile
mongoimport -d database -c collection --file importfile --upsert
@guange2015
guange2015 / gist:7728312
Created December 1, 2013 03:53
rbenv记事
RUBY_CONFIGURE_OPTS=--with-readline-dir=`brew --prefix readline`
@guange2015
guange2015 / Demo.cpp
Created November 13, 2013 15:11
寻找导入表
// Demo.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
HMODULE hModule = GetModuleHandle(NULL);