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
@jesperronn
jesperronn / docx2md.md
Last active Jun 21, 2019 — forked from aembleton/docx2md.md
Convert a Word Document into MD
View docx2md.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 / Gemfile
Created Nov 28, 2012
HS code scraper
View Gemfile
source 'https://rubygems.org'
gem "nokogiri"
View .simplecov
SimpleCov.coverage_dir('tmp/coverage')
# save to CircleCI's artifacts directory if we're on CircleCI
# see https://circleci.com/docs/code-coverage
if ENV['CIRCLE_ARTIFACTS']
dir = File.join(ENV['CIRCLE_ARTIFACTS'], 'coverage')
SimpleCov.coverage_dir(dir)
end
require 'simplecov-csv'
View delete_svn_subfolders.reg
Windows Registry Editor Version 5.00
;
; Running this file will give you an extra context menu item in Windows Explorer
; "Delete SVN folders"
;
; For the selected folder, it will remove all subfolders named ".svn" and their content
; Tip from http://www.iamatechie.com/remove-all-svn-folders-in-windows-xp-vista/
;
; Enrichened with comments by Jesper Rønn-Jensen ( http://justaddwater.dk/ )
;
View Jenkinsfile
// example Jenkinsfile with the following features
//
// * parallel build
// * Slack notifications
// * Clickable links to relevant commits and healthcheck urls
// * Multisite deployments
def git_host = "https://github.com/company/project_name"
def host = [
integration: [
@jesperronn
jesperronn / 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
View Howto convert a PFX to a seperate .key & .crt file
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]`
View pre-commit.bat
REM Subversion pre-commit hook for Windows machine
REM put this in your SVN repository folder /hooks/pre-commit.bat
REM we use it with svn version
REM http://stackoverflow.com/questions/869248/windows-pre-commit-hook-for-comment-length-subversion
@echo off
:: Stops commits that have empty log messages.
@echo off
setlocal
@jesperronn
jesperronn / ramdisk.sh
Created Dec 11, 2017 — forked from rxin/ramdisk.sh
ramdisk create/delete on Mac OS X.
View ramdisk.sh
#!/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 / json-reformat.sh
Created Feb 19, 2017
reformat json: read filename and write it again in the same name
View json-reformat.sh
#!/usr/bin/env/bash
# reformat json: read filename and write it again in the same name
#
# read JSON file and save it again reformatted
#
# usage:
# `reformat my.json`
reformat(){
node -e "
var fs = require('fs')
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
#
# path = require 'path'
#
You can’t perform that action at this time.