Skip to content

Instantly share code, notes, and snippets.

View waruqi's full-sized avatar
👋
I may be slow to respond.

ruki waruqi

👋
I may be slow to respond.
View GitHub Profile
@waruqi
waruqi / pi.h
Created November 11, 2010 15:41
compute pi using c++ MPL
/* ///////////////////////////////////////////////////////////////////////
* File: pi.h
*
* Created: 08.09.27
* Updated: 08.09.27
*
* Brief: Caculate pi = 3.14159265358979
*
* [<Home>]
* Copyright (c) 2008-2020, Waruqi All rights reserved.
@waruqi
waruqi / basic_pool.h
Created November 11, 2010 15:48
a memory pool
/* ///////////////////////////////////////////////////////////////////////
* File: basic_pool.h
*
* Created: 08.04.14
* Updated: 08.04.28
*
* Brief: basic_pool class
*
* [<Home>]
* Copyright (c) 2008-2020, Waruqi All rights reserved.
@waruqi
waruqi / httpd.c
Last active August 29, 2015 14:05
http server demo using asio
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "../demo.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* macros
*/
// the httpd port
@waruqi
waruqi / spider.c
Created August 18, 2014 07:08
a spider demo using asio
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "../demo.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* macros
*/
// the spider url maxn
@waruqi
waruqi / stream.c
Created August 18, 2014 07:09
a http downloader using stream
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "../demo.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* types
*/
typedef struct __tb_demo_context_t
{
@waruqi
waruqi / xmake.lua
Created June 24, 2016 06:07
A demo project file based on xmake
-- xmake: https://github.com/waruqi/xmake
-- define target
target("console")
-- set kind
set_kind("binary")
-- add files
add_files("src/*.c")
@waruqi
waruqi / xmake.lua
Created June 24, 2016 06:09
the project file for tbox
-- xmake: https://github.com/waruqi/xmake
-- project
set_project("tbox")
-- version
set_version("1.5.1")
-- set warning all as error
set_warnings("all", "error")
@waruqi
waruqi / xmake.lua
Created June 24, 2016 06:10
merge static library
-- the debug mode
if is_mode("debug") then
-- enable the debug symbols
set_symbols("debug")
-- disable optimization
set_optimize("none")
end
@waruqi
waruqi / book.m
Created November 9, 2016 07:48 — forked from mdippery/book.m
An example of using @dynamic properties in Objective-C
#import <Foundation/Foundation.h>
@interface Book : NSObject
{
NSMutableDictionary *data;
}
@property (retain) NSString *title;
@property (retain) NSString *author;
@end
@waruqi
waruqi / replace.py
Created January 9, 2017 15:12
replace multiline text
#!/usr/bin/python
#
##The Text Replacer
#
# @author ruki
# @file replace.py
#
# ######################################################################################
# imports