Skip to content

Instantly share code, notes, and snippets.

View pmeinhardt's full-sized avatar
🚲

Paul Meinhardt pmeinhardt

🚲
View GitHub Profile
@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 / hack.sh
Created March 31, 2012 10:08 — forked from DAddYE/hack.sh
osx for hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@pmeinhardt
pmeinhardt / webinspect-ios-simulator.sh
Created April 27, 2012 10:16
web-inspect mobile safari running in the ios simulator
#!/bin/bash
# Based on Nathan de Vries' findings http://goo.gl/jbtzX
MSPID=$(ps x | grep "MobileSafari" | grep -v grep | awk '{ print $1 }')
if [ -z "$MSPID" ]; then
echo "Run \"Mobile Safari.app\" in the Simulater to enable remove debugging."
exit 1
fi
@pmeinhardt
pmeinhardt / completion.rb.patch
Created July 18, 2012 09:53
patch irb completion
--- completion.rb 2012-07-18 11:48:41.000000000 +0200
+++ completion-2.rb 2012-07-18 11:53:02.000000000 +0200
@@ -165,6 +165,7 @@
rescue Exception
name = ""
end
+ next unless name.class == String
next if name != "IRB::Context" and
/^(IRB|SLex|RubyLex|RubyToken)/ =~ name
candidates.concat m.instance_methods(false).collect{|x| x.to_s}
@pmeinhardt
pmeinhardt / webdrive.rb
Created September 18, 2012 06:39
interactive capybara session
#!/usr/bin/env ruby
require 'irb'
require 'irb/completion'
require 'selenium/webdriver'
require 'capybara/dsl'
if ARGV.delete "--chrome"
chrome = true
@pmeinhardt
pmeinhardt / gist:3949491
Created October 24, 2012 23:03
OAuth 2 for Native Apps
@pmeinhardt
pmeinhardt / guide.md
Created November 17, 2012 18:28
clean rails server setup

Server setup

Basic setup

The baseline setup:

  1. Nginx will be used to reverse proxy to the Rails app (run by unicorn/thin/...)
  2. A non-privileged user is created, which will be running the app and used for safe deployments
  3. For this user, we'll install:
  4. rbenv (https://github.com/sstephenson/rbenv) to manage multiple Ruby versions
@pmeinhardt
pmeinhardt / notes.md
Last active November 5, 2015 21:03
Om, React and ClojureScript
@pmeinhardt
pmeinhardt / unicorn.rb
Last active December 10, 2015 00:59
capistrano unicorn integration
# Unicorn itself is configured in `config/unicorn.rb`. These are the tasks,
# that allow you to control the server through Capistrano's `cap` command.
# To understand how Unicorn reacts to each signal, you should really read
# http://unicorn.bogomips.org/SIGNALS.html
namespace :unicorn do
task :start do
env = fetch(:rails_env, "production")
run <<-EOC