Skip to content

Instantly share code, notes, and snippets.

View jesperronn's full-sized avatar

Jesper Rønn-Jensen jesperronn

View GitHub Profile
@jesperronn
jesperronn / docx2md.md
Last active November 21, 2023 12:49 — forked from aembleton/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

@jesperronn
jesperronn / Howto convert a PFX to a seperate .key & .crt file
Created April 15, 2016 12:46 — forked from TemporaryJam/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`
@jesperronn
jesperronn / ramdisk.sh
Created December 11, 2017 09:44 — forked from rxin/ramdisk.sh
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@jesperronn
jesperronn / loading_spinner.coffee
Last active February 3, 2016 09:11 — forked from cpuguy83/loading_spinner.coffee
Simple loading spinner for long requests with turbolinks and bootstrap modal. This fork: HTML for Bootstrap 3.3.x
@PageSpinner =
spin: (ms=500)->
@spinner = setTimeout( (=> @add_spinner()), ms)
$(document).on 'page:change', =>
@remove_spinner()
spinner_html: '
<div class="modal hide fade" id="page-spinner" role="dialog">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
@jesperronn
jesperronn / Capfile
Created January 26, 2016 11:43 — forked from troelskn/Capfile
Sample cap setup
# Load DSL and set up stages
require 'capistrano/setup'
# Include default deployment tasks
require 'capistrano/deploy'
# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
<div id="remote">
<input class="typeahead" type="text" placeholder="Oscar winners for Best Picture">
</div>
@jesperronn
jesperronn / instructions.txt
Created October 16, 2012 11:36 — forked from natritmeyer/instructions.txt
Cucumber formatter to list all tags
To list all tags scattered across your feature files...
1) add the following "list_tags.rb" file to your features/support directory
2) cucumber -d -f Cucumber::Formatter::ListTags
The output now has both tags and number of occurrences:
@backend-required 4
@issues 1
@localstub 1
@jesperronn
jesperronn / etc-init.d-unicorn.sh
Created June 14, 2012 20:17 — forked from matiaskorhonen/gist:420880
Unicorn /etc/init.d/unicorn script
#!/bin/bash
### BEGIN INIT INFO
# Provides: Unicorn
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 2 4 6
# Short-Description: Start unicorn web server at boot - port 3000
# Description: Enable cancerventetid application at boot time. Start the unicorn web server (port 3000)
### END INIT INFO
@jesperronn
jesperronn / unicorn
Created June 14, 2012 20:01
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@jesperronn
jesperronn / unicorn
Created June 14, 2012 20:01
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##