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.

Application = {}
jQuery(function($) {
for( key in Application) {
if( Application.hasOwnProperty(key)) {
if (typeof Application[key]["init"] === "function" && $('body').hasClass('with-js-' + key.toLowerCase())){
Application[key].init($)
}
};
};
}
;; Remove Scroll bar and toolbar, leave the menu though, it can be useful
(toggle-scroll-bar -1)
(menu-bar-mode 1)
(tool-bar-mode 0)
;; Start in the Scratch buffer by default
(blink-cursor-mode 0)
(setq initial-scratch-message "")
(setq inhibit-startup-message t)
@eightbitraptor
eightbitraptor / .offlineimaprc
Created January 8, 2014 09:17
offlineimaprc
[general]
ui = ttyui
accounts = Eightbitraptor
pythonfile=~/.mutt/offlineimap.py
fsync = False
cacertfile = ~/.mutt/certificates
[Account Eightbitraptor]
localrepository = Eightbitraptor-Local
remoterepository = Eightbitraptor-Remote
@eightbitraptor
eightbitraptor / patch.sh
Created December 10, 2013 13:54
apply a patch to a single file from a specific branch or revision from git.
# From the root of your repository.
git show <treeish> -- /path/to/file.rb | patch -p1
#!/usr/bin/python
import re, subprocess
def get_keychain_pass(account=None, server=None):
params = {
'security': '/usr/bin/security',
'command': 'find-internet-password',
'account': account,
'server': server,
'keychain': '/Users/matthewvalentine-house/Library/Keychains/login.keychain',
"use strict";
var MyClass = (function() {
function MyClass(publicString) {
this.publicString = publicString;
};
var privateString = "I'm a private string that can't be accessed directly";
// ============================================================================