Skip to content

Instantly share code, notes, and snippets.

Jesper Rønn-Jensen jesperronn

Block or report user

Report or block jesperronn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mareksuscak /
Created Mar 15, 2015
Bump version shell script.
# Thanks goes to @pete-otaqui for the initial gist:
# Original version modified by Marek Suscak
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3" or even "1.2.3-beta+001.ab"
tobiashm / capistrano-database.rb
Last active Aug 29, 2015
Capistrano recipe for creating PostgreSQL database user
View capistrano-database.rb
Capistrano::Configuration.instance(true).load do
namespace :db do
desc "Create database user for current site"
task :create_user, roles: :db do
config ="..", "database.yml")
config =
config = YAML.load(config)
fail "No database config for #{stage}" unless config[stage.to_s]
username, password = config[stage.to_s].values_at("username", "password")
run "#{sudo as: 'postgres'} psql -d postgres" do |channel, _, _|
vitorbritto /
Last active Dec 5, 2019
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
#!/usr/bin/env bash
size=1024 # MB
name=$(basename "$mount_point")
usage() {
echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \
"(default: mount)" >&2
trcook /
Last active Feb 18, 2018
Advanced Rake Rules and Conditional Rake Rules

rules matching by regex

Occassionally we want to make a rule that matches on something more complex than file extensions. If, for example files that will be prefixed with pandoc_ depend on files that do not contain the prefix.

Ex: pandoc_slides=>slides.rmd. we can make a rule that will capture this, but we need to use a lambda function to do so:

rule (%r{pandoc_.*\.md}) => lambda{|objfile| potential_source_files.find{objfile.pathmap("%{pandoc_,}n")}} do |t|
	puts "This rule gets #{} from #{t.source}"
View screen_cheatsheet.markdown

Screen Quick Reference


Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
staltz /
Last active Dec 9, 2019
The introduction to Reactive Programming you've been missing
KyleJamesWalker /
Last active Nov 14, 2017
Vagrant SSH Agent Forwarding Working 1.4.3

This was working on Vagrant 1.4.3 (Mac).


File: ~/.ssh/config

Host vagrant.*
ForwardAgent yes

File: Vagrantfile

sbrin / index.html
Last active Sep 7, 2019
Paste MS Word Text Jquery plugin
View index.html
<!DOCTYPE html>
<div id="src">Source here...</div>
<div id="editor" contenteditable="true">
<p>Place MS-Word text here...</p>
mguymon / factory_girl_helper.rb
Last active Jan 27, 2016
RSpec helper for adding find_or_create to FactoryGirl for Rails
View factory_girl_helper.rb
module FactoryGirlHelper
def find_or_create(*args)
name = args.shift
clazz = nil
# convert from underscores String to camelcase Class
if name.is_a? Hash
name = name.first[0]
clazz = name.first[1].to_s.camelize.constantize
You can’t perform that action at this time.