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
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
# 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
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
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
private static String MAIN = "/crafty.clj"; | |
private Object crafty = null; // hold onto reference for loaded clojure file | |
@Override | |
public void onLoad() { | |
// executeScript will return an instance of clojure.lang.Var | |
crafty = executeScript(getClass().getResourceAsStream( MAIN ), MAIN); | |
try { | |
// is there a way I can invoke "onLoad" using the `crafty` reference I've created? | |
RT.var("crafty.core", "onLoad").invoke(); |
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
@Override | |
public void onLoad() { | |
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); | |
try { | |
crafty = executeScript(getClass().getResourceAsStream( "/crafty/core.clj" ), "/crafty/core.clj"); | |
} catch (Exception e) { | |
System.out.println(e.getMessage()); | |
} | |
protected Object executeScript(InputStream ins, String path) { |
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
# Set up gems listed in the Gemfile. | |
gemfile = File.expand_path('../../Gemfile', __FILE__) | |
begin | |
ENV['BUNDLE_GEMFILE'] = gemfile | |
require 'bundler' | |
Bundler.setup | |
rescue Bundler::GemNotFound => e | |
STDERR.puts e.message | |
STDERR.puts "Try running `bundle install`." | |
exit! |
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
#include "shared.h" | |
void insert_item(int item, int semid, int *shared_buffer) { | |
int index = get_buffer_size(shared_buffer); | |
shared_buffer[index] = item; | |
} | |
int produce_item() { | |
return 0xFF; // nothing dynamic just write a static integer a slot | |
} |