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
//!/usr/bin/dtc -I dts -O dtb -o bonnet.dtbo bonnet.dts | |
// Overlay for Adafruit's OLED Bonnet https://www.adafruit.com/product/3531 | |
// May need to add "fbcon=map:1" to /boot/cmdline.txt | |
/dts-v1/; | |
/plugin/; | |
/ { | |
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; |
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
#!/usr/bin/ruby | |
module LinuxProcInfo | |
def self.cpucount | |
File.readlines("/proc/cpuinfo").find_all { |s| s.start_with?('processor') }.count | |
end | |
def self.loadavg | |
File.read('/proc/loadavg').split[0, 3].collect(&:to_f) | |
end |
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
*~ | |
TODO.html |
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
# This should print "nada" unless stdin has data. | |
while true | |
i, o, e = IO.select([$stdin], nil, nil, 0) | |
if i.include?($stdin) | |
c = $stdin.readpartial(1024) | |
puts c.inspect | |
else | |
puts "nada" |
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 "console_parser.hpp" | |
class ConsoleParserTest: public CxxTest::TestSuite | |
{ | |
public: | |
class Callback: public ConsoleParser::CommandCallback | |
{ | |
public: | |
bool called; | |
int argc; |
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
#!/usr/bin/env ruby | |
# | |
# Minus the logging, this is the simplest file system that's most likely | |
# possible with RFuse-NG. It presents a single directory level that stores | |
# the contents of files in a Hash. | |
# | |
# This is in the public domain. | |
# | |
# Enjoy, | |
# sneakin |
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
class Foo | |
def bar | |
baz # is it a method, an attribute, or a local variable | |
end | |
end |
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
def wont_raise | |
raise "Catch me if you can" | |
ensure | |
puts "ensured" | |
return "HA" | |
end | |
def will_raise | |
raise "Caught me" | |
ensure |
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 'spec' | |
require 'active_support' | |
class Rule < Struct.new(:quantity, :price) | |
def apply(number) | |
[ number / quantity * price, number % quantity ] | |
end | |
end | |
class CheckOut < Struct.new(:rules, :items) |
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
Scenario: happy path | |
When I send "connect alice password" | |
Then I see | |
""" | |
Hello alice! For help, enter "/help". | |
""" | |
And I see "You are standing in the mud." | |
And I see "There is a helicopter a click to your six and two crates a yard ahead." | |
And I see "Direction: east" | |
And the people I see are: alice |
NewerOlder