Skip to content

Instantly share code, notes, and snippets.

@brianmario
brianmario / bzip2.rb
Created June 21, 2013 18:43
[WIP] Simple libbz2 wrapper using FFI
require 'ffi'
module Bzip2
extend FFI::Library
ffi_lib 'bz2'
class Error < StandardError; end
class ConfigError < Error; end
class BufferError < Error; end
def blah
"test"
end
# This is a TOML document. Boom.
title = "TOML Example"
[owner]
name = "Tom Preston-Werner"
organization = "GitHub"
bio = "GitHub Cofounder & CEO\nLikes tater tots and beer."
dob = 1979-05-27T07:32:00Z # First class dates? Why not?
testing
lol
@brianmario
brianmario / bars.md
Last active June 14, 2019 21:29
Some places to check out in Portland

Bars

PROTIP: Bars in Oregon have to serve food as long as they're serving alcohol. As a result, some of them have amazing food.

PROTIP: You can't buy alcohol (other than beer or wine) anywhere else but a state-controlled liquor store. Most of them are closed on Sundays and close around 7pm every other night of the week.

Southeast

  • The Night Light - This was our favorite bar just before we moved to Italy. Right in the heart of the quiet Clinton district (where we were living at the time).
  • The Doug Fir Lounge - I hate to use the word swanky again but that's the only way I can describe it. The entire place is built to look like a log cabin. Used to go here all the time. Pretty good bar. The restaurant is open until 3am (or at least was when I lived there) and has some DAMN good gastro pub style food. The halibut fish and chips and burger are insane. Funny enough, I saw the GitHub guys here (including maddox and Tek I think?) after
@brianmario
brianmario / utf8_clean.rb
Last active December 9, 2020 20:21
Quick little pure-ruby UTF-8 string verification and cleaning utility
require 'strscan'
module UTF8Util
HIGH_BIT_RANGE = /[\x80-\xff]/n
ENCODING_SUPPORT = "".respond_to?(:force_encoding)
REPLACEMENT = "?"
# Check if this String is valid UTF-8
#
testing 00-metro
testing
class TestMailer < ActionMailer::Base
default :from => "from@example.com"
def testing
mail.deliver
end
end