Skip to content

Instantly share code, notes, and snippets.

View jfirebaugh's full-sized avatar

John Firebaugh jfirebaugh

View GitHub Profile
diff -r bf7fb95dc4e8 ext/pg_connection.c
--- a/ext/pg_connection.c Mon Oct 01 08:05:35 2012 -0700
+++ b/ext/pg_connection.c Mon Oct 22 21:51:46 2012 -0700
@@ -866,6 +866,7 @@
else {
Check_Type(param_value, T_STRING);
/* make sure param_value doesn't get freed by the GC */
+ RB_GC_GUARD(param_value);
rb_ary_push(gc_array, param_value);
paramValues[i] = StringValuePtr(param_value);
var faithful = [
79, 54, 74, 62, 85, 55, 88, 85, 51, 85, 54, 84, 78, 47, 83, 52, 62, 84, 52, 79, 51, 47, 78, 69, 74, 83, 55, 76, 78, 79, 73, 77, 66, 80, 74, 52, 48, 80, 59, 90, 80, 58, 84, 58, 73, 83, 64, 53,
82, 59, 75, 90, 54, 80, 54, 83, 71, 64, 77, 81, 59, 84, 48, 82, 60, 92, 78, 78, 65, 73, 82, 56, 79, 71, 62, 76, 60, 78, 76, 83, 75, 82, 70, 65, 73, 88, 76, 80, 48, 86, 60, 90, 50, 78, 63, 72,
84, 75, 51, 82, 62, 88, 49, 83, 81, 47, 84, 52, 86, 81, 75, 59, 89, 79, 59, 81, 50, 85, 59, 87, 53, 69, 77, 56, 88, 81, 45, 82, 55, 90, 45, 83, 56, 89, 46, 82, 51, 86, 53, 79, 81, 60, 82, 77,
76, 59, 80, 49, 96, 53, 77, 77, 65, 81, 71, 70, 81, 93, 53, 89, 45, 86, 58, 78, 66, 76, 63, 88, 52, 93, 49, 57, 77, 68, 81, 81, 73, 50, 85, 74, 55, 77, 83, 83, 51, 78, 84, 46, 83, 55, 81, 57,
76, 84, 77, 81, 87, 77, 51, 78, 60, 82, 91, 53, 78, 46, 77, 84, 49, 83, 71, 80, 49, 75, 64, 76, 53, 94, 55, 76, 50, 82, 54, 75, 78, 79, 78, 78, 70, 79, 70, 54, 86, 50, 90, 54, 54, 77, 79, 64,
75, 47, 86, 63, 85, 82, 57, 82, 67,
@jfirebaugh
jfirebaugh / gist:4007524
Created November 3, 2012 14:26
Installing Ruby 2.0.0-preview1 with RVM on OS X
# First, make sure that you have the most recent rvm. Several bugs with 2.0.0-preview1
# have recently been fixed.
#
# Second, the openssl that comes with MacOS is too old for Ruby 2.0. You need to install
# a newer one with homebrew or the rvm pkg command.
# Option 1, with homebrew openssl:
brew update
brew install openssl

I spent last year working on the iD editor for OpenStreetMap and on the design and functionality of OpenStreetMap.org. I'm going to talk a little bit and at a high level about the technical side of those efforts — enough to give you an idea of what their goals were — but most of this talk is about the human side, about community management and open source stewardship.

My hope for this talk is that sharing what worked for me and my collaborators will help three groups of people: first, open source contributors who, like me, want to help the project tackle big technical challenges. Second, other outside organizations — public or private — that want to engage effectively with the OSM community. And finally, members of the community who want to see OpenStreetMap become a more friendly and welcoming community for everyone who would like to contribute.

I work at Mapbox — Mapbox paid me to work on iD and on the website. So first I want to answer the question: why does Mapbox care about OpenStreetMap anyway? Why wo

load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image")
nodejs_image(
name = "image",
entry_point = "index.js",
)

Hi ____,

I appreciate you reaching out. Unfortunately, I can't consider working at Uber because I believe that the company behaves unethically and has produced a culture that is harmful to its employees, to the software engineering profession, and indeed to the public at large. Specifically:

  • Numerous allegations of sexual harassment and mistreatment of women employees
  • Attempts to evade regulatory investigation and oversight via greyballing
  • Running an unpermitted self-driving car program in San Francisco in which vehicles ran red lights, lurched into intersections, and made illegal right turns, putting pedestrians, cyclists, and other drivers at risk, and then misleading the public about whether the incidents occurred while the vehicle was under autonomous control
  • Reports from former forensic investigator that lack of internal controls allowed employees to track high profile politicians, celebrities, personal acquaintances, and ex-partners
  • The participation of Travis Kalanick in Trump's business ad
const numFeatures = 100;
const numPolygons = 5;
const numRings = 10;
const numPoints = 10000;
console.time('populate storage');
const features = [];
for (let i = 0; i < numFeatures; i++) {
@jfirebaugh
jfirebaugh / jquery.readyselector.js
Created May 4, 2012 18:18
$(<selector>).ready() -- a nice syntax for page-specific script
/*
With the Rails asset pipeline, you usually include the JS for
your entire application in one bundle, but individual scripts
should be run only on certain pages. This extends jQuery's
.ready() to provide a nice syntax for page-specific script:
$('.posts.index').ready(function () {
// ...
});
@jfirebaugh
jfirebaugh / playground.rs
Created October 16, 2016 21:15 — forked from anonymous/playground.rs
Shared via Rust Playground
enum Expression {
Literal(u32),
Add(Box<Expression>, Box<Expression>),
Sub(Box<Expression>, Box<Expression>)
}
impl Expression {
fn map<F: Fn(Expression) -> Expression>(self, f: F) -> Expression {
match self {
Expression::Literal(_) => self,
@jfirebaugh
jfirebaugh / node-debug.md
Last active June 3, 2016 15:35
Tips and tricks for debugging native modules in node

Building a native module (node-gyp) with debug symbols

cd node_modules/module
node-gyp rebuild --debug

(You might have to adjust require paths from Release to Debug.)

Building node with debug symbols