Skip to content

Instantly share code, notes, and snippets.

View eightbitraptor's full-sized avatar

Matt Valentine-House eightbitraptor

View GitHub Profile
gc_symbol_list = `gcc -shared -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/unicode/15.0.0 -fPIC -Wl,--unresolved-symbols=report-all gc.c -o libgc.so 2>&1`
libruby_symbol_list = `nm -C libruby.so.3.3.0`.split("\n")
project_tags = `ctags -f - -R --tag-relative=yes --languages=C,C++ --extras=+f --exclude=.ext --exclude=rb_mjit_header.h .`
class CTagNode
include Comparable
attr_reader :symbol, :file, :type
attr_accessor :visibility
@eightbitraptor
eightbitraptor / benchmarking-results.r
Last active January 22, 2021 15:38
benchmarking data for variable width allocation project initial microbenchmark results
if (!requireNamespace('tidyverse'))
install.packages('tidyverse')
if (!requireNamespace('ggplot2'))
install.packages('ggplot2')
library(ggplot2)
library(tidyverse)
# Uncomment these to run either set of numbers
@eightbitraptor
eightbitraptor / parser_splat_comma_repro.rb
Created January 28, 2020 17:10
a repro script for a bug in the way ruby parser handles splats followed by commas
require 'minitest/autorun'
require 'ruby_parser'
FirstException = Class.new(StandardError)
SecondException = Class.new(StandardError)
ThirdException = Class.new(StandardError)
EXCEPTIONS = [SecondException]
def my_method(error)

Code Review Request!

I am building a command line application. Part of the application relies on a configuration file. The intended behaviour is to have this configuration file as a dotfile in the users home directory. The configuration files are written using TOML.

The cli ui has a -c/--config option that the user can use to provide the path to an alternate configuration file.

If the -c parameter is used the application must read the provided config file and parse it otherwise it will fall back to ~/.application.toml

The configuration file is parsed and a Config struct is built that maps the values in the config to fields on the struct. At the moment, there is only one param in the config file: data_path. so the Struct is very simple.

Keybase proof

I hereby claim:

  • I am eightbitraptor on github.
  • I am eightbitraptor (https://keybase.io/eightbitraptor) on keybase.
  • I have a public key whose fingerprint is 874C 92A6 58DD D077 1FC6 AD26 5352 2D82 09EF 1866

To claim this, I am signing this object:

================================================================================
Error executing action `install` on resource 'td-agent_gem[gelf]'
================================================================================
NoMethodError
-------------
undefined method `clear_sources' for Chef::Resource::TdAgentGem
Resource Declaration:
---------------------
fn last_but_one(list: &Vec<int>) -> int {
// create a mutable copy of list
let mut mylist = list;
// reverse mylist in place
mylist.reverse();
// get a reference to the second element and return it
let second: &int = mylist.get(1);
fn last_but_one(list: Vec<int>) -> Option<int> {
println!("{}", list.reverse());
match list.is_empty() {
true => { None }
false => { list.reverse().get(1) }
};
}
#[test]
fn main() {
for number in range(1,101) {
let output = match number {
x if x % 5 == 0 && x % 3 == 0 => { "FizzBuzz".to_str() }
x if x % 5 == 0 => { "Buzz".to_str() }
x if x % 3 == 0 => { "Fizz".to_str() }
x @ _ => { x.to_str() }
};