Skip to content

Instantly share code, notes, and snippets.

@ohAitch
ohAitch / the_good_rust.rs
Created October 30, 2020 23:08 — forked from iximeow/the_good_rust.rs
monkeypatching in rust
trait Person {
fn greeting(&self) -> StateOfMind;
fn name(&self) -> &'static str;
}
struct Ixi { }
struct Katie { }
#[derive(Debug)]
enum StateOfMind {
@ohAitch
ohAitch / pong
Last active August 29, 2015 14:04 — forked from arishal/pong
puts "1"
require "curses"
include Curses
include Math
def pong
# ALL THIS NEEDS TO BE DISPLAYED SOMEHOW
# show “CONTROL THE PADDLE WITH THE W AND S KEYS” in the middle of the board for a few seconds
score = 0
scof = 1.0
paddle = 50.0 # max y-coordinate/2, making the board 100x100 for now
$.getScript("https://rawgit.com/gilmoreorless/jquery-nearest/master/src/jquery.nearest.min.js");
$("#stdKeyboard").hide()
$("#stenoKeyboard").css({
width: "95%",
height: "50%",
left: "1%"
});
function sendKey(keyDiv, dir) {
var e = $.Event(dir);