Skip to content

Instantly share code, notes, and snippets.

View pmeinhardt's full-sized avatar
🚲

Paul Meinhardt pmeinhardt

🚲
View GitHub Profile
@pmeinhardt
pmeinhardt / data-uri.rb
Last active December 10, 2015 01:58
encode files with the data-uri scheme using base64
#!/usr/bin/env ruby
require 'base64'
require 'rack/mime'
if ARGV.empty?
puts "usage: #{File.basename($0)} [glob ...]"
exit 0
end
@pmeinhardt
pmeinhardt / compress-js.rb
Created January 15, 2013 23:56
ruby wrapper script for google closure compiler
#!/usr/bin/env ruby
begin
require 'closure-compiler'
rescue LoadError => e
puts e.message
puts "to fix: gem install 'closure-compiler'"
exit 1
end
@pmeinhardt
pmeinhardt / capybara-cheatsheet.md
Last active December 14, 2015 16:29 — forked from zhengjia/capybara cheat sheet
overview of the capybara dsl

Capybara Cheat Sheet

View the original gist: https://gist.github.com/428105

Navigating

visit "/projects"
visit post_comments_path(post)

Clicking Links and Buttons

@pmeinhardt
pmeinhardt / styleguides.md
Last active December 21, 2015 06:18
styleguide resources
@pmeinhardt
pmeinhardt / raspberry-pi-setup.sh
Last active July 9, 2016 09:31
Raspberry Pi Setup (using Raspbian Jessie Lite)
# RASPBIAN JESSIE LITE
#
# Version: May 2016
# Release date: 2016-05-27
# Kernel version: 4.4
#
# https://www.raspberrypi.org/downloads/raspbian/
# boot and login (default username: pi, password: raspberry)
@pmeinhardt
pmeinhardt / config.txt
Last active July 9, 2016 10:52
HiFiBerry Setup (Raspbian Jessie Lite, Kernel 4.4)
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
@pmeinhardt
pmeinhardt / session.rb
Last active April 15, 2017 18:18
sign users in/out in cucumber scenarios, without filling in a sign-in form each time (using warden, works with devise)
# features/support/session.rb
# Sign-in users directly, without going through the sign-in form each time.
#
# Including the Warden::Test::Helpers in the cucumber world, allows us
# to call login_as(user, opts = {}) and logout(*scopes) in cucumber steps.
#
# http://git.io/h1NRxQ
Before do |scenario|
@pmeinhardt
pmeinhardt / shairport-pi.sh
Created June 29, 2016 18:21
AirPlay via Raspberry Pi 3
# Tested on a Raspberry Pi 3 running Raspbian Jessie Lite (2016-05-27,, kernel 4.4)
# – http://computers.tutsplus.com/tutorials/using-a-raspberry-pi-as-an-airplay-receiver--mac-54316
# install dependencies
sudo apt-get install build-essential libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl libmodule-build-perl libasound2-dev libao-dev pulseaudio libpulse-dev avahi-utils libavahi-client-dev
# configure and build
git clone https://github.com/abrasive/shairport.git
cd shairport
./configure
@pmeinhardt
pmeinhardt / README.md
Last active June 23, 2017 11:56
Troubleshooting Travis-CI builds locally

Docker setup and running a (language-specific) Travis-CI docker image:

# install docker tools (e.g. via homebrew)
brew install docker docker-machine

# create a docker machine (https://docs.docker.com/machine/)
docker-machine create --driver virtualbox default

# set up your shell session for docker
# Example code for connecting to OpenSSH ssh-agent and retrieving key information,
# quickly hacked together so please excuse bad naming and style etc.
#
# This is just intended to provide a starting point
#
# http://api.libssh.org/rfc/PROTOCOL.agent
# https://github.com/paramiko/paramiko/blob/master/paramiko/agent.py
# Message constants
ssh2_agentc_request_identities = 11