Skip to content

Instantly share code, notes, and snippets.

View jesperronn's full-sized avatar

Jesper Rønn-Jensen jesperronn

View GitHub Profile
@aembleton
aembleton / docx2md.md
Last active May 17, 2023 07:04 — forked from vdavez/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@drewsberry
drewsberry / ublock-filter.md
Created March 30, 2015 15:18
ublock Analytics Filter

ublock Allow Google Analytics

  • Go to ublock settings and select the "Filters" tab

  • In the box, copy the following filter rule in:

    @@||google-analytics.com^

  • Click "Apply changes"

  • You're done

@mareksuscak
mareksuscak / bump-version.sh
Created March 15, 2015 12:56
Bump version shell script.
#!/bin/bash
# Thanks goes to @pete-otaqui for the initial gist:
# https://gist.github.com/pete-otaqui/4188238
#
# 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
tobiashm / capistrano-database.rb
Last active August 29, 2015 14:14
Capistrano recipe for creating PostgreSQL database user
Capistrano::Configuration.instance(true).load do
namespace :db do
desc "Create database user for current site"
task :create_user, roles: :db do
config = Pathname.new(__dir__).join("..", "database.yml")
config = ERB.new(config.read).result(binding)
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
vitorbritto / rm_mysql.md
Last active April 23, 2024 14:21
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
mount_point=$HOME/tmp
name=$(basename "$mount_point")
usage() {
echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \
"(default: mount)" >&2
}
@trcook
trcook / rakefile.md
Last active February 18, 2018 10:34
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 #{t.name} from #{t.source}"
end
@jctosta
jctosta / screen_cheatsheet.markdown
Last active April 18, 2024 18:19
Screen Cheatsheet

Screen Quick Reference

Basic

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
@staltz
staltz / introrx.md
Last active April 20, 2024 14:15
The introduction to Reactive Programming you've been missing
@KyleJamesWalker
KyleJamesWalker / VagrantSSHAngentForwardingWithAnsible.md
Last active December 10, 2019 01:37
Vagrant SSH Agent Forwarding Working 1.4.3

This was working on Vagrant 1.4.3 (Mac).

#HOST#

File: ~/.ssh/config

Host vagrant.*
ForwardAgent yes

File: Vagrantfile