Skip to content

Instantly share code, notes, and snippets.

View bil-bas's full-sized avatar

Bil Bas bil-bas

View GitHub Profile
@bil-bas
bil-bas / gist:1444523
Created December 7, 2011 20:35
nanoc compilation when nothing has changed
C:\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby193\bin\rake compile
Loading site data...
Compiling site...
** Generating tags
Creating: nanoc (1)
Creating: website (1)
Creating: ruby (9)
Creating: alpha_channel (3)
Creating: game (6)
Creating: gosu (6)
@bil-bas
bil-bas / player.rb
Created December 1, 2011 04:23
Rubywarrior (Beginner) code that completes tower
require 'forwardable'
=begin
Rubywarrior beginner level:
Level 1: S
Level 2: A
Level 3: A
Level 4: A
Level 5: A
@bil-bas
bil-bas / gist:1405413
Created November 29, 2011 16:30
webrick fails for pry.github.com
spooner@spooner-VirtualBox:~/RubymineProjects/pry.github.com$ foreman start
16:26:28 jekyll.1 | started with pid 15708
16:26:29 compass.1 | started with pid 15711
16:26:33 jekyll.1 | Configuration from ./_config.yml
16:26:33 jekyll.1 | Auto-regenerating enabled: ./ -> ./_site
16:26:33 jekyll.1 | [2011-11-29 16:26:33] regeneration: 32 files changed
16:26:34 compass.1 | >>> Change detected to: style.scss
16:26:34 jekyll.1 | [2011-11-29 16:26:34] INFO WEBrick 1.3.1
16:26:34 jekyll.1 | [2011-11-29 16:26:34] INFO ruby 1.9.2 (2011-02-18) [x86_64-linux]
16:26:34 jekyll.1 | /usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/utils.rb:63:in `getaddrinfo': getaddrinfo: Servname not supported for ai_socktype (SocketError)
@bil-bas
bil-bas / gist:1405149
Created November 29, 2011 15:22
ray segfault (Z&G)
spooner@spooner-VirtualBox:~/RubymineProjects/zed_and_ginger$ ruby bin/zed_and_ginger.rbw
OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x1d1ea30
OpenGL Warning: Retry with 0x8002 returned 0 visuals
/usr/share/ruby-rvm/gems/ruby-1.9.2-p180/gems/ray-0.2.0/lib/ray/game.rb:98: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
-- control frame ----------
c:0012 p:---- s:0052 b:0052 l:000051 d:000051 CFUNC :(null)
c:0011 p:---- s:0050 b:0050 l:000049 d:000049 CFUNC :new
c:0010 p:0142 s:0047 b:0047 l:000046 d:000046 METHOD /usr/share/ruby-rvm/gems/ruby-1.9.2-p180/gems/ray-0.2.0/lib/ray/game.rb:98
@bil-bas
bil-bas / zed_and_ginger.rbw
Created November 27, 2011 03:29
Z&G: maybe not suppress the errors?
#!/usr/bin/env ruby
require 'optparse'
EXTRACT_PATH = File.dirname(File.dirname(File.expand_path(__FILE__)))
ROOT_PATH = if ENV['OCRA_EXECUTABLE']
File.dirname(File.expand_path(ENV['OCRA_EXECUTABLE']))
elsif defined? OSX_EXECUTABLE_FOLDER
File.dirname(OSX_EXECUTABLE_FOLDER)
@bil-bas
bil-bas / gist:1353666
Created November 10, 2011 00:23
texplay 0.4 error
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing texplay:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for main() in -lfreeglut_static... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
@bil-bas
bil-bas / 01_bank.sgl.json
Created November 6, 2011 15:23
Smash and Grab level
{
"comment": "Smash and Grab save game",
"version": "Alpha",
"game_started_at": "2011-11-03 22:46:05 +0000",
"last_saved_at": "2011-11-05 15:23:04 +0000",
"map_size": [
50,
50
],
"tiles": [
@bil-bas
bil-bas / gist:1324598
Created October 29, 2011 15:39
ocra fails with gosu 0.7.38
gemspecpath = "C:/Ruby192/lib/ruby/gems/1.9.1/specifications/gosu-0.7.38-i386-mingw32.gemspec"
spec = Gem::Specification.load(gemspecpath) # nil
=begin
C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:624:in `block in find_gem_files': undefined method `full_name' for nil:NilClass (NoMethodError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:581:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:581:in `find_gem_files'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:702:in `build_exe'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1139:in `block in <top (required)>'
require 'ray'
ImageWidth = 640
ImageHeight = 480
image = Ray::Image.new [ImageWidth, ImageHeight]
Ray::ImageTarget.new image do |target|
target.shader.compile(:frag => StringIO.new(<<eof))
#version 110
@bil-bas
bil-bas / gist:1131597
Created August 8, 2011 11:19
pry in Z&G
pry(#<Intro game=game("Zed and Ginger")>):3> cd particle_generator
pry(#<ParticleGenerator:0x2b2d8d8>):4> cd @active[1]
pry(#<Particle:0x2b2d2d8>):5> cd ..
NameError: undefined local variable or method `output' for Pry::Helpers::BaseHel
pers:Module
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/pry-0.9.3-x86-mingw32/lib/pry/helpers/b
ase_helpers.rb:92:in `block in simple_pager'
pry(#<Intro game=game("Zed and Ginger")>):4> cat --ex
# a simple pager for systems without `less`. A la windows.