Skip to content

Instantly share code, notes, and snippets.

@polarblau
polarblau / install_pg_gem.sh
Created Apr 26, 2020
Installing the pg gem when using the postgres.app
View install_pg_gem.sh
# No pg_config... trying anyway. If building fails, please try again with
# --with-pg-config=/path/to/pg_config
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/[YOUR postgres.app VERSION]/bin/pg_config
View eventable.js
'use strict';
/** Base class for generic event handling.
* @example
*
* // Don’t forget to call `super()` if defining a constructor.
* class Foo extends Eventable {}
* let foo = new Foo();
*
* foo.on('bar', (data) => console.log(data));
View chart.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
@polarblau
polarblau / work_days_2016.md
Created Jan 14, 2016
Work days / Berlin, Germany (2016)
View work_days_2016.md
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Days: 20 21 21 21 20 22 21 23 22 20 22 21
Hours: 150 157,5 157,5 157,5 150 165 157,5 172,5 165 150 165 157,5

(Hours calculations are based on 7.5 hour days.)

View interview-questions.md

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@polarblau
polarblau / amzn_wish_list_transfer.rb
Last active Mar 17, 2021
Transferring Amazon wish list entries the hard way between international stores.
View amzn_wish_list_transfer.rb
#!/usr/bin/env ruby
require "rubygems"
require "mechanize"
SOURCE_LOGIN_URL = "https://www.amazon.com/ap/signin?_encoding=UTF8&openid.assoc_handle=usflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.com%2Fgp%2Fcss%2Fhomepage.html%3Fie%3DUTF8%26*Version*%3D1%26*entries*%3D0%26ref_%3Dnav_signin"
TARGET_LOGIN_URL = "https://www.amazon.de/ap/signin?_encoding=UTF8&openid.assoc_handle=deflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2F
@polarblau
polarblau / grid_utils.sass
Created Oct 3, 2015
Grid utilities, based on bourbon/neat.
View grid_utils.sass
// Settings
$grid-visual-aid-breakpoints: () !global !default
$grid-media-default-feature : min-width !default
$grid-max-columns : 12 !default
$grid-default-columns : 2 !default
$grid-float-direction : left !default
$grid-gutter-width : 30px !default
$grid-max-width : 1200px !default
// Scoped
View ping.sh
#!/bin/bash
HOST="some-host.com"
ERROR_MESSAGE="Some Host server unreachable!"
while true
do
status=$(curl -s -I $HOST | grep HTTP/1.1 | awk {'print $2'})
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
@polarblau
polarblau / install_pg_with_config.sh
Created May 13, 2015
Installing PG gem with postgres.app
View install_pg_with_config.sh
gem install pg -- --with-pg_config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
@polarblau
polarblau / work_days_2015.md
Last active Aug 29, 2015
Work days / Berlin, Germany (2015)
View work_days_2015.md
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Days: 21 20 22 20 18 22 23 21 22 22 21 22
Hours: 157,5 150 165 150 135 165 172,5 157,5 165 165 157,5 165

(Hours calculations are based on 7.5 hour days.)