Skip to content

Instantly share code, notes, and snippets.

@brianmario
brianmario / pool.go
Last active August 29, 2015 13:58
Connection pool example for Go
type ConnectionPool chan *Conn
func (p *ConnectionPool) Checkout() *Conn {
<- p
}
func (p *ConnectionPool) Checkin(conn *Conn) {
p <- conn
}
@brianmario
brianmario / nyc.md
Created October 9, 2014 23:32
List of some spots I like to eat at.

Coffee

Manhattan

  • Stumptown Coffee - Inside the Ace Hotel lobby. These guys started in Portland but have a couple of locations in NYC. Amazing coffee.
  • Blue Bottle - Originally an SF joint, they've also expanded over to NYC. I have one two blocks from my house and go almost every morning ;) The cappuccino's and "New Orleans" (iced coffee with chicory and a tiny amount of sugar) are amazing. They usually have small pastries that are really good too.

Brooklyn

  • Blue Bottle - The Brooklyn location is in Williamsburg
---
Changelog | 1 +
MAINTAINERS | 1 +
configure | 12 ++
libavcodec/Makefile | 7 +
libavcodec/allcodecs.c | 4 +
libavcodec/h264.c | 1 +
libavcodec/mpeg12.c | 3 +
libavcodec/mpegvideo.c | 1 +
libavcodec/version.h | 2 +-
@brianmario
brianmario / jquery.autocompleteme.js
Created January 22, 2009 06:34
Account Auto Suggest
// HTML Response Autocompleter plugin
jQuery.fn.autocompleteme = function(options) {
return $(this).each(function() {
var input = $(this);
var settings = jQuery.extend({
url: '/accounts/autocomplete',
delay: 250,
resultsSelector: input.selector+'.results'
}, options);
var req = null;
@brianmario
brianmario / fiscal_calendar_extensions.rb
Created January 26, 2009 22:05
Time extensions for Fiscal Calendar
# Time object extension adding fiscal calendar calculations based on an offset month
class Time
# The first day of the current fiscal quarter of this Time object instance, based on the passed offset_month
def beginning_of_fiscal_quarter(offset_month=1)
t = beginning_of_fiscal_year(offset_month)
4.times do
return t if self >= t && self < t+3.months
t = t+3.months
end
end
@brianmario
brianmario / jquery.validation.js
Created January 31, 2009 04:58
jQuery form validation plugin
//
// validatesPresence
//
// This validator ensures value presence
// The default options are:
//
// invalidClass: 'invalid-presence',
// blankValue: '',
// when: callBack(context)
// validatesOn: ['change', 'blur']
@brianmario
brianmario / jquery.infinite_scroll.js
Created February 5, 2009 20:20
jQuery infinite scroll plugin
// Infinite Scroll
jQuery.fn.infiniteScroll = function(options) {
return $(this).each(function() {
var el = $(this);
var settings = jQuery.extend({
url: null,
triggerAt: 300,
page: 2,
appendTo: '.list',
container: $(document)
static VALUE someCallback(void * ctx) {
ctx = Qtrue;
}
static VALUE blah() {
VALUE ctx = Qnil;
someCallback(ctx);
// Outputs: NilClass
VALUE ctx;
static VALUE someCallback(void * ctx) {
ctx = Qtrue;
}
static VALUE blah() {
ctx = Qnil;
someCallback(ctx);
for file in `find . -type f -name '*.jsn'`; do mv $file ${file%.jsn}.json; done