Skip to content

Instantly share code, notes, and snippets.

View brianjking's full-sized avatar
💭
Doin' cool stuff at BrandMuscle AI

Brian J King brianjking

💭
Doin' cool stuff at BrandMuscle AI
View GitHub Profile
@brianjking
brianjking / markdown-to-rst-pandoc-automation.py
Created January 8, 2016 16:38
Convert Markdown to RST for Sphinx automatically using Pandoc - NEEDS TESTED. Obtained via: http://www.pythonbackend.com/topic/1268949527
#!/usr/bin/env python
import os
import subprocess
DOCUMENTATION_SOURCE_DIR = 'documentation/source/'
SOURCE_EXTENSION = '.md'
OUTPUT_EXTENSION = '.rst'
for _, __, filenames in os.walk(DOCUMENTATION_SOURCE_DIR):
for filename in filenames:
@wieshka
wieshka / ajenti.conf
Created December 21, 2015 23:42
Working NGINX configuration for Ajenti reverse proxy
server {
listen *:443 ssl;
listen *:80;
ssl_certificate /etc/self-signed-ssl/cert.crt;
ssl_certificate_key /etc/self-signed-ssl/cert.key;
server_name FQDN;
access_log /var/log/nginx/ajenti-web-panel.access.log;
error_log /var/log/nginx/ajenti-web-panel.error.log;
@brianjking
brianjking / .bashrc
Created December 10, 2015 16:23 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@g-p-g
g-p-g / letsencrypt.md
Last active March 9, 2016 15:00
Using letsencrypt

Download

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt

Generate SSL certificate

@dphiffer
dphiffer / rpi_setup.md
Last active February 19, 2016 00:24
Raspberry Pi setup
@jesperronn
jesperronn / docx2md.md
Last active May 22, 2025 20:00 — 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

@kovshenin
kovshenin / subscribers-count.php
Created November 19, 2015 13:03
Get subscribers count via the MailChimp API.
<?php
/**
* Get subscribers count via the MailChimp API.
*/
function mailchimp_get_subscribers_count() {
$cache_key = 'mailchimp-subscribers';
$api_key = '';
$username = '';
$dc = '';
$list_id = '';
@egardner
egardner / config.rb
Last active October 7, 2022 09:54
PDF Output for Middleman
# Only the relevant parts of config.rb are included here
require "extensions/pdf"
# ...
configure :build do
activate :pdf do |pdf|
pdf.print_template = "/catalogue/print-template.html"
end
end
@brianjking
brianjking / dueling-dogs-monitor.log
Last active November 15, 2015 17:12
DUELING DOGS MONITOR LOG
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
 
************** Exception Text **************
System.BadImageFormatException: Could not load file or assembly 'SimpleIO-M, Version=1.1.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
@renchap
renchap / README.md
Last active February 14, 2025 13:25
One-line certificate generation/renews with Letsencrypt and nginx

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {