Skip to content

Instantly share code, notes, and snippets.

View dmreiland's full-sized avatar

Dan Reiland dmreiland

View GitHub Profile
@dmreiland
dmreiland / springer-free-maths-books.md
Created December 28, 2015 18:32 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@dmreiland
dmreiland / proxy.js
Created December 29, 2015 19:28 — forked from nakedible-p/proxy.js
AWS ES proxy
var AWS = require('aws-sdk');
var http = require('http');
var httpProxy = require('http-proxy');
var express = require('express');
var bodyParser = require('body-parser');
var stream = require('stream');
if (process.argv.length != 3) {
console.error('usage: aws-es-proxy <my-cluster-endpoint>');
process.exit(1);
@dmreiland
dmreiland / appify
Created March 9, 2016 15:30 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@dmreiland
dmreiland / README.md
Created April 11, 2016 17:10 — forked from blackjid/README.md
How configure your raspberry pi with dashing to have a awesome dashboard

Raspberry pi dashboard

This is what we did to setup a few dashboards at platanus

You'll need

  • Raspberry Pi
  • Dashing Service
  • Wifi stick (optional)
@dmreiland
dmreiland / crashplan-setup.sh
Created June 17, 2016 01:18 — forked from earchibald/crashplan-setup.sh
bash script to set up CrashPlan client on OS X. Should be easily modifiable to support Linux.
#!/usr/bin/env bash
# crashplan-setup.sh
usage () {
echo "Usage: $0 <server> [user]"
exit 255
}
SERVER="$1"
@dmreiland
dmreiland / DockerSpringBootLoggingUsingSyslogAndLogstash.md
Created June 20, 2016 20:00 — forked from jamescookie/DockerSpringBootLoggingUsingSyslogAndLogstash.md
Centralised logging for Docker containers running Spring Boot applications

Centralised logging for Docker containers running Spring Boot applications

Log flow through the system

Log flow

About

We have a bunch of Spring Boot apps running in various Docker containers and wanted a centralised place to view the logs

## convert HTML POST data or HTTP GET query string to JSON
## get the raw post data from the AWS built-in variable and give it a nicer name
#if ($context.httpMethod == "POST")
#set($rawAPIData = $input.path('$'))
#elseif ($context.httpMethod == "GET")
#set($rawAPIData = $input.params().querystring)
#set($rawAPIData = $rawAPIData.toString())
#set($rawAPIDataLength = $rawAPIData.length() - 1)
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength))
@dmreiland
dmreiland / q_example.js
Created August 7, 2016 16:53 — forked from jeffcogswell/q_example.js
Here's another chaining example on using q.js. This doesn't have any error handling, as I just want to demonstrate the chaining concept. Please read the comments carefully, as I start out with a non-q example, to show the order of flow. Please post comments if there's anything that isn't clear and I'll try to revise it as needed.
// Q sample by Jeff Cogswell
/*===========
We want to call these three functions in sequence, one after the other:
First we want to call one, which initiates an ajax call. Once that
ajax call is complete, we want to call two. Once two's ajax call is
complete, we want to call three.
BUT, we don't want to just call our three functions in sequence, as this quick
@dmreiland
dmreiland / promises.md
Created August 7, 2016 23:31 — forked from domenic/promises.md
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@dmreiland
dmreiland / nginx.conf
Created November 21, 2016 21:27 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048