Skip to content

Instantly share code, notes, and snippets.

Brandon nevern02

Block or report user

Report or block nevern02

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nevern02
nevern02 / twitch_bot.rb
Last active Mar 17, 2020
A quick example of a Twitch chat bot using Ruby.
View twitch_bot.rb
# A quick example of a Twitch chat bot in Ruby.
# No third party libraries. Just Ruby standard lib.
#
# See the tutorial video: https://www.youtube.com/watch?v=_FbRcZNdNjQ
#
# You can fill in creds here or use environment variables if you choose.
TWITCH_CHAT_TOKEN = ENV['TWITCH_CHAT_TOKEN']
TWITCH_USER = ENV['TWITCH_USER']
@nevern02
nevern02 / my_server.rb
Last active Jul 27, 2018
Introductory Rack-compliant web server
View my_server.rb
require 'socket'
require 'rack'
require 'sinatra'
# Simple, rack-compliant web server
class MyServer
STATUS_CODES = {
200 => 'OK',
500 => 'Internal Server Error'
}
@nevern02
nevern02 / method_tracing.rb
Created Nov 28, 2014
Experimenting with method tracing via metaprogramming in Ruby.
View method_tracing.rb
module MethodTracing
class Tracer
class << self
attr_reader :tracers
end
@tracers = {}
attr_accessor :count
attr_reader :target
@nevern02
nevern02 / .vimrc
Last active Aug 29, 2015
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.
View .vimrc
" 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"] }
You can’t perform that action at this time.