This file contains 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
struct StaticDamageSystem; | |
impl<'s> System<'s> for StaticDamageSystem { | |
type SystemData = ( | |
WriteStorage<'s, Health>, | |
ReadStorage<'s, StaticDamage>, | |
ReadStorage<'s, TilePosition>, | |
); | |
fn run(&mut self, (mut healths, damages, positions): Self::SystemData) { |
This file contains 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
object endl {} | |
object cout { | |
def <<(e: endl.type) = { | |
print("\n") | |
this | |
} | |
def <<(s: String) = { | |
print(s) | |
this | |
} |
This file contains 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
// will it compile with "SCALA_OPTS=-Xfatal-warnings"? | |
sealed trait ADT | |
final case class Apple(id: Int) extends ADT | |
final case class Banana(id: String) extends ADT | |
final case class Pear(id: Boolean) extends ADT | |
object Obj { | |
def fun(x: ADT): String = { |
This file contains 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
fn bar(y: ~int) {} | |
fn foo() { | |
let x = box 75; | |
if ... | |
{ | |
bar(x); | |
} | |
} |
This file contains 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
// 3rd party library source | |
// g++ -fPIC -shared coutstub.cpp -o libcoutstub.so | |
#include <iostream> | |
#include "coutstub.hpp" | |
void print() | |
{ |
This file contains 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 <iostream> | |
#include <memory> | |
class A | |
{ | |
public: | |
A() | |
: m_int(new int(10)) | |
{} |
This file contains 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
require 'json' | |
require 'open-uri' | |
host = ARGV[0] | |
raise "Missing argument: host" if host.nil? | |
jenkins_root = JSON.parse(open("http://#{host}/api/json").read) |