Skip to content

Instantly share code, notes, and snippets.

View take-cheeze's full-sized avatar
💤

Takeshi Watanabe take-cheeze

💤
View GitHub Profile
#!/usr/bin/env ruby -Ku
# coding: UTF-8
class Table
def initialize(x, y = 1, z = 1)
end
end
class Color
def initialize(r,g,b,a)
@take-cheeze
take-cheeze / CMakeLists.txt
Created February 6, 2013 23:58
cotire test
cmake_minimum_required(VERSION 2.8)
project(EasyRPG_Player CXX C)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../lib)
link_directories(${LIBRARY_OUTPUT_PATH})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Modules")
$ grep -i rpg200 ~/.wine/*.reg (git-svn)-[take_cheeze]
/Users/takeshi/.wine/system.reg:[Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\RPG2000.exe] 1351732799
/Users/takeshi/.wine/system.reg:@="C:\\Program Files\\ASCII\\RPG2000\\RPG2000.exe"
/Users/takeshi/.wine/system.reg:"Path"="C:\\Program Files\\ASCII\\RPG2000"
/Users/takeshi/.wine/system.reg:[Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\RPG2000T.exe] 1360163084
/Users/takeshi/.wine/system.reg:@="C:\\Program Files\\ASCII\\RPG2000T\\RPG2000T.exe"
/Users/takeshi/.wine/system.reg:"Path"="C:\\Program Files\\ASCII\\RPG2000T"
/Users/takeshi/.wine/system.reg:@="C:\\Program Files\\Enterbrain\\RPG2003\\yourapp.Exe"
/Users/takeshi/.wine/system.reg:"Path"="C:\\Program Files\\Enterbrain\\RPG2003"
/Users/takeshi/.wine/system.reg:"DisplayIcon"="C:\\Program Files\\ASCII\\RPG2000\\RPG2000.ico"
// ./bin/sq test.nut aaa
// -> aaa
print(vargv[0] + "\n")
@take-cheeze
take-cheeze / test.nut
Created February 19, 2013 08:12
2.x.x
// ./bin/sq test.nut aaa
// -> aaa
print(ARGS[0] + "\n")
@take-cheeze
take-cheeze / gist:5010976
Created February 22, 2013 05:34
lua version fix
diff --git a/src/platform/lua_bot.cpp b/src/platform/lua_bot.cpp
index a927e9d..72275c8 100644
--- a/src/platform/lua_bot.cpp
+++ b/src/platform/lua_bot.cpp
@@ -96,7 +96,11 @@ void LuaBot::resume() {
assert(L);
assert(lua_type(L, -1) == LUA_TTHREAD);
+#if LUA_VERSION_NUM >= 502
+ switch(lua_resume(executer_, L, 0)) {
diff --git a/src/platform/lua_bot.cpp b/src/platform/lua_bot.cpp
index a927e9d..5660d9e 100644
--- a/src/platform/lua_bot.cpp
+++ b/src/platform/lua_bot.cpp
@@ -62,7 +62,7 @@ void LuaBot::register_vm(lua_State* const L) {
LuaBot::LuaBot(std::string const& script)
: script_(script), executer_(NULL)
{
- vm_.reset(lua_open(), &lua_close);
+ vm_.reset(luaL_newstate(), &lua_close);
@take-cheeze
take-cheeze / feed_checker.coffee
Created March 5, 2013 13:38
feed checker for hubot
# Description:
# Feed Checker
#
# Dependencies:
# 'feedparser': '*'
#
# Configuration:
# FEED_CHECK_INTERVAL
#
# Commands:
@take-cheeze
take-cheeze / FindRuby.cmake
Created March 7, 2013 11:08
new FindRuby.cmake
# RUBY_EXECUTABLE
# RUBY_LIBRARY
# RUBY_INCLUDE_DIRS
# RUBY_INCLUDE_PATH
# RUBY_DEFINITIONS
# RUBY_VERSION
find_program(RUBY_EXECUTABLE ruby)
if(RUBY_EXECUTABLE)
message(STATUS "ruby found: ${RUBY_EXECUTABLE}")
diff --git a/src/platform/wine_registry.cpp b/src/platform/wine_registry.cpp
index 3df7e93..a839e53 100644
--- a/src/platform/wine_registry.cpp
+++ b/src/platform/wine_registry.cpp
@@ -84,7 +84,8 @@ struct parse_registry {
line.clear();
std::string tmp;
do {
- if(not line.empty() and *line.rbegin() == '\\') { line.erase(line.rbegin().base()); }
+ if(not line.empty() and *line.rbegin() == '\\')