Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Valentine-House eightbitraptor

View GitHub Profile
@eightbitraptor
eightbitraptor / benchmarking-results.r
Last active Jan 22, 2021
benchmarking data for variable width allocation project initial microbenchmark results
View benchmarking-results.r
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 Jan 28, 2020
a repro script for a bug in the way ruby parser handles splats followed by commas
View parser_splat_comma_repro.rb
require 'minitest/autorun'
require 'ruby_parser'
FirstException = Class.new(StandardError)
SecondException = Class.new(StandardError)
ThirdException = Class.new(StandardError)
EXCEPTIONS = [SecondException]
def my_method(error)
View rust_review.md

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.

View keybase.md

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:

View gist:0099e6cfb6a54333951b
================================================================================
Error executing action `install` on resource 'td-agent_gem[gelf]'
================================================================================
NoMethodError
-------------
undefined method `clear_sources' for Chef::Resource::TdAgentGem
Resource Declaration:
---------------------
View Readme.md
View stuff.rs
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);
View gist:2d33d1dd9a3c68478f94
fn last_but_one(list: Vec<int>) -> Option<int> {
println!("{}", list.reverse());
match list.is_empty() {
true => { None }
false => { list.reverse().get(1) }
};
}
#[test]
View fizzbuzz.rs
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() }
};
@eightbitraptor
eightbitraptor / main.rs
Created Jun 19, 2014
I don't understand how linking works I think
View main.rs
#![link_args = "-lkyotocabinet"]
extern crate libc;
use libc::types;
extern {
fn kctime() -> libc::c_double;
}
#[test]