Skip to content

Instantly share code, notes, and snippets.

View openmailbox's full-sized avatar

openmailbox

View GitHub Profile
@openmailbox
openmailbox / twitch_bot.rb
Last active August 16, 2025 15:56
A quick example of a Twitch chat bot using Ruby.
# A quick example of a Twitch chat bot in Ruby. No third party libraries. Just Ruby standard lib.
#
# This software is made available under the MIT License.
# Copyright (C) 2025 Brandon Rice
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@openmailbox
openmailbox / my_server.rb
Last active August 16, 2025 15:58
Introductory Rack-compliant web server
# An example of a very simple, rack-compliant web server.
# This software is made available under the MIT License.
#
# Copyright (C) 2025 Brandon Rice
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@openmailbox
openmailbox / method_tracing.rb
Created November 28, 2014 04:09
Experimenting with method tracing via metaprogramming in Ruby.
module MethodTracing
class Tracer
class << self
attr_reader :tracers
end
@tracers = {}
attr_accessor :count
attr_reader :target
@openmailbox
openmailbox / .vimrc
Last active August 29, 2015 14:06
If you're sick of syntastic taking forever to check your dart files, make sure you have vim-dispatch (https://github.com/tpope/vim-dispatch) installed and stick this in your vimrc. Doesn't help the startup time of dartanalyzer, but at least your main thread won't block.
" dart setup
autocmd FileType dart set errorformat+=%.%#\\\|%.%#\\\|%.%#\\\|%f\\\|%l\\\|%c\\\|%.%#\\\|%m
autocmd FileType dart set makeprg=dartanalyzer\ --machine\ %
autocmd BufWritePre *.dart Make
let g:syntastic_mode_map = { "mode": "active",
\ "passive_filetypes": ["dart"] }