Skip to content

Instantly share code, notes, and snippets.


David Ellis davidkellis

View GitHub Profile
davidkellis / Vagrantfile
Created Nov 19, 2019
vagrant box: ubuntu 18.04 + rustup + rust + tesseract
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
View able v1 parse tree and ast example
david:~/Dropbox/projects/able/compiler $ crystal src/ -- -f ../examples/
parse tree:
(apply File ; id=5414918336 rule_name="File" label=""
(choice ; id=5414918416 label=""
(seq ; id=5414918496 label=""
(apply PackageDecl ; id=5414919936 rule_name="PackageDecl" label=""
(choice ; id=5414920016 label=""
(seq ; id=5414920096 label=""
"package"[id=5452605472 label=""]
(apply package_ident ; id=5414904128 rule_name="package_ident" label=""
View gist:b87695e8cf8cf7b762a67ea7c60a6b39
# solution to
def main
lower_bound = 1
upper_bound = 100
puts "Think of a number between 1 and 100, inclusive."
puts "At each guess, answer with 'l' to indicate your number is lower than the guess, 'h' to indicate your number is higher than the guess, or 'y' to indicate the guess is correct."
while true
guess = (lower_bound + upper_bound) / 2
puts "Is #{guess} your number?"
davidkellis /
Last active Dec 10, 2018
bar project in Crystal (that calls the foo library, implemented in Rust -

How to run:

$ crystal run src/
hello from crystal
Just called a Rust function from C!
davidkellis / Cargo.toml
Last active Dec 10, 2018
foo project in rust (to be called from a crystal project called bar -
View Cargo.toml
name = "foo"
version = "0.1.0"
authors = ["davidkellis <>"]
crate-type = ["cdylib"]
View part1.rb
ints = File.readlines("input.txt").map(&:to_i)
puts ints.sum


confefe, pronounced con-feef, is a simple configuration language

confefe supports 8 different data types, plus comments:

  • nil/null
  • bool
  • int
  • decimal
  • string
address: "localhost:6667"
channel: "#hello"
- passthru: true
filter: "boss"
message: "Hi, boss!"
- passthru: false
filter: ".*"
name: "confefe"
version: "1.2.0"
- "foo"
- "bar"
- "baz"
authors: ["Bill", "Bob"]
dependencies: [ # dependencies captured in a nested array
["stdlib", "~> 1.2"],
View gist:999db7501342ca2c85d4e49513c67d2c
davidellis@davidellis:~/Dropbox/projects/benchmarks (master) $ ./run.rb
Running base64 benchmark suite
Running helloworld benchmark suite
Running json benchmark suite