Skip to content

Instantly share code, notes, and snippets.

View rpbaptist's full-sized avatar

Richard Baptist rpbaptist

  • Rotterdam, Netherlands
View GitHub Profile
@rpbaptist
rpbaptist / xlsx_columns.rb
Last active February 21, 2020 13:09
Spreadsheet column calculation in Ruby
# frozen_string_literal: true
class XlsxColumns
attr_reader :position
ALPHABET = ("A".."Z").to_a
class << self
def column(position)
if position > max_position
raise ArgumentError, "Position must be #{max_position} or lower"
@rpbaptist
rpbaptist / cachable_concern.rb
Last active May 14, 2018 09:31
A cache wrapper implementation with simple interface
# spec/support/shared/examples/cachable.rb
# frozen_string_literal: true
# Provide a simple interface for caching methods
# Usage examle:
#
# class Foo
# include Cachable
# cache :bar
@rpbaptist
rpbaptist / font-replacement.css
Created May 4, 2017 11:31
Font replacement for Stylish browser extension: Use open source and personally preferred fonts
@font-face {
font-family: 'Consolas';
src: local('Source Code Pro'), local('SourceCodePro-Regular');
}
@font-face {
font-family: 'Courier New';
src: local('Source Code Pro'), local('SourceCodePro-Regular');
}
@rpbaptist
rpbaptist / Alpenglow-deuteranopia.tmTheme
Created April 10, 2017 12:10
My version of the Alpenglow theme, being more color blind friendly
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Alpenglow - Monokai</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@rpbaptist
rpbaptist / aws-download.sh
Created May 19, 2016 10:55
Download all files from AWS S3 from a list generated with AWS CLI
#!/bin/bash
# USE CASE
# I have a bucket with a lot of files and someone else wants to download them.
# They don't have AWS CLI for rsyncing.
# PURPOSE
# It is possible to generate a list of files present in an AWS bucket with the
# AWS CLI:
# aws s3 ls s3://bucket-name/path/ --region eu-west-1 --recursive | tee aws-files.txt
@rpbaptist
rpbaptist / css-overrides.css
Last active September 15, 2016 09:31
CSS overrides I use with chrome extension Stylish
@font-face {
font-family: 'Consolas';
src: local('Source Code Pro'), local('SourceCodePro-Regular');
}
@font-face {
font-family: 'Courier New';
src: local('Source Code Pro'), local('SourceCodePro-Regular');
}

Keybase proof

I hereby claim:

  • I am rpbaptist on github.
  • I am rpbaptist (https://keybase.io/rpbaptist) on keybase.
  • I have a public key ASAARVtDddPhz67s0EpW-FJJEMjebEZebzS5PCqnhIq5QQo

To claim this, I am signing this object: