Skip to content

Instantly share code, notes, and snippets.

View Quintus's full-sized avatar

Marvin Gülker Quintus

View GitHub Profile
# -*- coding: utf-8 -*-
require "observer"
class Hero
include Observable
attr_accessor :hp
def initialize
require "test/unit"
class AnonModule < Module
attr_reader :name
def initialize(klass,name,&block)
super(&block)
@name = name
@klass = klass
@Quintus
Quintus / states.rb
Last active December 15, 2015 20:19
require "test/unit"
require "turn/autorun"
module Game
class State
attr_reader :name
def initialize(name)
@name = name
#cs_init
end
@Quintus
Quintus / config.log
Created March 23, 2013 13:11
CEGUI configure.log snippet, shows requiring of `tolua++`.
configure:20583: checking for Lua
configure:20590: $PKG_CONFIG --exists --print-errors "lua >= 5.1"
configure:20593: $? = 0
configure:20607: $PKG_CONFIG --exists --print-errors "lua >= 5.1"
configure:20610: $? = 0
configure:20648: result: yes
configure:20872: i686-pc-mingw32-gcc -E -I. -DCEGUI_LUA_VER=51 conftest.c
conftest.c:57:33: fatal error: tolua++.h: No such file or directory
#include <tolua++.h>
^
(1008) [17:54:21 quintus@roma] ~
% ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
(1009) [17:55:21 quintus@roma] ~
% gem -v
2.0.0
(1010) [17:55:22 quintus@roma] ~
% gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.0
(1001) [17:51:12 quintus@roma] ~
% ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
(1002) [17:51:16 quintus@roma] ~
% gem -v
2.0.0
(1003) [17:51:17 quintus@roma] ~
% gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.0
# jruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_13-b20 [linux-amd64]
[12] pry(main)> str = "AA\xC3AA"
=> "AA\xC3AA"
[13] pry(main)> str.encoding
=> #<Encoding:UTF-8>
[14] pry(main)> str.force_encoding("BINARY")
=> "AA\xC3AA"
[15] pry(main)> str.encode("UTF-8")
Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8
@Quintus
Quintus / gem_make.out
Created November 5, 2012 12:14
compilation log
/opt/rubies/rubinius/bin/rbx extconf.rb
checking for -Wall option to compiler... yes
checking for -Waggregate-return option to compiler... yes
checking for -Wcast-align option to compiler... yes
checking for -Wextra option to compiler... yes
checking for -Wformat=2 option to compiler... yes
checking for -Winit-self option to compiler... yes
checking for -Wlarger-than-65500 option to compiler... yes
checking for -Wmissing-declarations option to compiler... yes
checking for -Wmissing-format-attribute option to compiler... yes
@Quintus
Quintus / segfault.c
Created October 9, 2012 14:57
libgit2 segfault on git_checkout_tree()
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <git2.h>
int main(int argc, char* argv[])
{
git_repository* p_repo;
git_reference* p_ref;
git_reference* p_head;
@Quintus
Quintus / gist:2561002
Created April 30, 2012 18:43
i3 workspaces
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require "pp"
require "json"
require "socket"
module I3
class Error
end