Skip to content

Instantly share code, notes, and snippets.

View Quintus's full-sized avatar

Marvin Gülker Quintus

View GitHub Profile
@Quintus
Quintus / _part.rhtml
Created November 20, 2010 09:20
Sinatra issue 126
<p>ä</p>
√ quintus@hades => /usr/lib/mozilla
$ export MOZILLA_FIVE_HOME=/usr/lib/xulrunner-2.0/
√ quintus@hades => /usr/lib/mozilla
$ export LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME
√ quintus@hades => /usr/lib/mozilla
$ redcar
Redcar 0.11 ( x86_64-linux )
java -client -Xbootclasspath/a:/home/quintus/.redcar/assets/jruby-complete-1.5.3.jar -Dfile.encoding=UTF8 -Xmx320m -Xss1024k -Djruby.memory.max=320m -Djruby.stack.max=1024k org.jruby.Main /opt/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/redcar-0.11/bin/redcar --no-sub-jruby --ignore-stdin --start-time=1303062609
Redcar 0.11 ( java )
@Quintus
Quintus / gist:1156638
Created August 19, 2011 11:46
RDoc -f option and RDOCOPT demonstration
√ quintus@ikarus => ~/Desktop/abc
$ echo $RDOCOPT
√ quintus@ikarus => ~/Desktop/abc
$ cat test.rb
#This is the Foo class.
class Foo
#This is the bar method.
def bar
@Quintus
Quintus / image_uploader.rb
Created November 20, 2011 14:59
Image uploader
# encoding: utf-8
class ImageUploader < CarrierWave::Uploader::Base
# Include RMagick or ImageScience support:
include CarrierWave::RMagick
# include CarrierWave::MiniMagick
# include CarrierWave::ImageScience
# Choose what kind of storage to use for this uploader:
@Quintus
Quintus / coderay-luascanner.patch
Created April 22, 2012 20:07
Lua scanner for CodeRay
diff --git a/lib/coderay/scanners/lua.rb b/lib/coderay/scanners/lua.rb
new file mode 100644
index 0000000..e7706fc
--- /dev/null
+++ b/lib/coderay/scanners/lua.rb
@@ -0,0 +1,267 @@
+# -*- coding: utf-8 -*-
+
+# Scanner for the Lua[http://lua.org] programming lanuage.
+#
@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
@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 / 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
# 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
(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