Skip to content

Instantly share code, notes, and snippets.

View pmeinhardt's full-sized avatar
🚲

Paul Meinhardt pmeinhardt

🚲
View GitHub Profile
@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 / 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
@pmeinhardt
pmeinhardt / index.html
Last active August 29, 2015 14:01
mediarecorder-demo (no file:/// urls, use a file server, works in firefox nightly - 24/05/2014)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Media Stream Recording</title>
</head>
<body>
<video id="playback" controls autoplay></video>
<button onclick="stopRecording()">stop</button>
<a id="download-link" href="#" download="recording.webm">Download</a>
@pmeinhardt
pmeinhardt / notes.md
Last active November 5, 2015 21:03
Om, React and ClojureScript
@pmeinhardt
pmeinhardt / download-site.md
Created October 10, 2013 17:12
download an entire page (including css, js, images) for offline-reading, archiving… using wget

If you ever need to download an entire website, perhaps for off-line viewing, wget can do the job — for example:

$ wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains website.org --no-parent  www.website.org/tutorials/html/

This command downloads the website www.website.org/tutorials/html/.

The options are:

  • --recursive: download the entire website
  • --domains website.org: don't follow links outside website.org
@pmeinhardt
pmeinhardt / styleguides.md
Last active December 21, 2015 06:18
styleguide resources
@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 / 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 / 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 / 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