This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def on_enable | |
| # Tell everyone in players world that they have joined | |
| event(:player_join) do |e| | |
| e.player.world.players.each do |p| | |
| p.send_message "Player #{e.player.name} has joined" | |
| end | |
| end | |
| # Tell everyone in players world that they have quit | |
| event(:player_quit) do |e| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I'm getting some weird behaviour running `autoconf -i` after cloning down mike | |
| When I run autoconf -i on the project it throws multiple warnings. | |
| However, if I run it again the warning messages disappear: | |
| ➜ mike git:(master) autoconf -i | |
| configure.ac:12: error: possibly undefined macro: AC_PROG_LIBTOOL | |
| If this token and others are legitimate, please use m4_pattern_allow. | |
| See the Autoconf documentation. | |
| configure.ac:13: error: possibly undefined macro: AM_PROG_CC_C_O | |
| configure.ac:49: error: possibly undefined macro: AM_INIT_AUTOMAKE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Find the named object in this tree's contents | |
| # | |
| # Examples | |
| # Repo.new('/path/to/grit').tree/'lib' | |
| # # => #<Grit::Tree "6cc23ee138be09ff8c28b07162720018b244e95e"> | |
| # Repo.new('/path/to/grit').tree/'README.txt' | |
| # # => #<Grit::Blob "8b1e02c0fb554eed2ce2ef737a68bb369d7527df"> | |
| # | |
| # Returns Grit::Blob or Grit::Tree or nil if not found | |
| def /(file) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class A | |
| private | |
| private | |
| private | |
| private | |
| private | |
| private | |
| private | |
| private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class A | |
| private | |
| def one | |
| end | |
| private | |
| def two |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Domingo = {} || Domingo | |
| -> | |
| class Camera | |
| constructor: (args...) -> | |
| console.log args | |
| Domingo.Camera = Camera |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class A | |
| def initialize | |
| @stub = lambda {|&block| [1,2,3,4].each{|n| block.call(n)}} | |
| end | |
| def each(&block) | |
| @stub.call(&block) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # we have to fake an enumerable object :) oh what fun! | |
| block = proc { | |
| [@zipfile].each do |file| | |
| yield | |
| end | |
| } | |
| @zip.stub!(:each).and_return(&block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Website.reflect_on_all_associations( :has_many ).each do | assoc | | |
| instance_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 | |
| if #{assoc.name}.first.respond_to?(:to_backup) | |
| xml.#{assoc.name} do | |
| #{assoc.name}.each {|collection| xml << collection.to_backup} | |
| end unless #{assoc.name}.blank? | |
| end | |
| RUBY_EVAL | |
| end |