Skip to content

Instantly share code, notes, and snippets.

@melpon
melpon / cc_ptr.hpp
Last active December 31, 2015 12:09
cocos2d 用 intrusive_ptr。適当に書いたので間違ってるところあるかも。
#ifndef CC_PTR_INCLUDED
#define CC_PTR_INCLUDED
/*
static void intrusive_ptr_add_ref(cocos2d::CCObject* p) {
p->retain();
}
static void intrusive_ptr_release(cocos2d::CCObject* p) {
p->release();
}
Error detected while processing function wandbox#dump_option_list..wandbox#list..wandbox#prettyprint#pp..<SNR>30_option:
line 2:
E716: Key not present in Dictionary: prettyprint_indent
E15: Invalid expression: has_key(b:, name) ? b:[name] : g:[name]
line 3:
E121: Undefined variable: opt
E116: Invalid arguments for function type(opt) == type('') ? eval(opt) : opt
E15: Invalid expression: type(opt) == type('') ? eval(opt) : opt
line 2:
E716: Key not present in Dictionary: prettyprint_width
Error detected while processing function wandbox#compile_and_dump..wandbox#compile:
line 11:
E605: Exception not caught: Request has failed! Status 500: Internal Server Error
Error detected while processing function wandbox#compile_and_dump:
line 1:
E170: Missing :endfor
@melpon
melpon / gist:8005579
Created December 17, 2013 14:19
vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 18 2013 02:20:44)
MacOS X (unix) version
Included patches: 1-923
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl
++builtin_terms -footer +multi_byte +terminfo
@melpon
melpon / with_lambda.hpp
Last active December 31, 2015 16:59
cocos2d-x のコールバックを 2.x で使えるようにしてみた
#ifndef WITH_LAMBDA_INCLUDED
#define WITH_LAMBDA_INCLUDED
#include "cocos2d.h"
template<class Base, class Result, class... Args>
class BindCallback : public Base {
public:
typedef std::function<Result (Args...)> Callback;
typedef Result (cocos2d::CCObject::*Handler)(Args...);
@melpon
melpon / not-yakiniku.rst
Last active January 1, 2016 10:09
焼肉以外のお店
@melpon
melpon / create_func.hpp
Last active January 2, 2016 08:59
cocos2d-x の CREATE_FUNC を C++ っぽくしてみた
#ifndef CREATE_FUNC_HPP_INCLUDED
#define CREATE_FUNC_HPP_INCLUDED
/*
使い方:
class TestLayer : public cocos2d::Layer {
public:
bool init();
CREATE_FUNC(TestLayer);
#ifndef EVENT_HPP_INCLUDED
#define EVENT_HPP_INCLUDED
/*
使い方:
#include <iostream>
#include "event.hpp"
struct Listener {
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 March 20, 2014 05:58
reST の内部ターゲットテスト

正常系

hoge

fuga

moke