Skip to content

Instantly share code, notes, and snippets.

View build-gcc.sh
set -ex
if [[ ! -e ~/local/gcc-4.8.2/bin/g++ ]]; then
pushd ~/
PWD=`pwd`
# install gmp
wget http://ftp.gnu.org/gnu/gmp/gmp-5.1.2.tar.bz2
tar xf gmp-5.1.2.tar.bz2
@melpon
melpon / test.rst
Created Mar 20, 2014
reST の内部ターゲットテスト
View test.rst

正常系

hoge

fuga

moke

View deflate.c
/* ========================================================================= */
int ZEXPORT deflateInit_(strm, level, version, stream_size)
z_streamp strm;
int level;
const char *version;
int stream_size;
{
return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
Z_DEFAULT_STRATEGY, version, stream_size);
/* To do: ignore strm->next_in if we use it as window */
@melpon
melpon / build.sh
Last active Aug 29, 2015
mono 4.0.1 のビルド
View build.sh
# apt-get install git autoconf libtool automake
git clone https://github.com/mono/mono.git
cd mono
git checkout mono-4.0.1.44
patch configure.ac /path/to/patch/configure.ac.patch
./autogen.sh --prefix=/path/to/install --disable-nls
make get-monolite-latest
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/basic.exe
make install
View Makefile.patch
2369,2371d2368
< for files in $(BUILD_SDK_DIR)/tapset/*.stp; do \
< $(INSTALL_DATA) $${files} $(DESTDIR)${prefix}/tapset; \
< done
2462,2465d2458
< if ENABLE_DOCS
< ${mkinstalldirs} $(DESTDIR)$(docdir)/html
< cp -RP $(BUILD_IMAGE_DIR)/docs $(DESTDIR)$(docdir)/html
< endif
View compile.sh
python make.py > test.json
curl -v -H "Content-type: application/json" --data-binary "@test.json" http://melpon.org/wandbox/api/compile.json
View distribute_setup.py
#!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools, set a download
View gist:2901389
$ pwd
/tmp/module
$ tree
.
├── fluent
│ ├── __init__.py
│ └── sender.py
└── plugin
├── __init__.py
View condition_variable.h
enum cv_status { cvs_no_timeout, cvs_timeout };
class condition_variable {
typedef pthread_cond_t native_type;
native_type cond_;
public:
typedef native_type* native_handle_type;
@melpon
melpon / shared_ptr.h
Created Jul 17, 2012
oreore shared_ptr
View shared_ptr.h
#ifndef UTIL_SHARED_PTR_H_INCLUDED
#define UTIL_SHARED_PTR_H_INCLUDED
// for swap in C++03
#include <algorithm>
// for swap in C++11
#include <utility>
#include <new>