Skip to content

Instantly share code, notes, and snippets.

##
# SSL Settings
##
# # openssl dhparam 4096 -out /etc/nginx/dh4096.pem
ssl_dhparam /etc/nginx/dh4096.pem;
ssl_protocols TLSv1.2;
# ssl_ecdh_curve secp521r1;
@michiel
michiel / clean-git-dirs.sh
Created August 24, 2016 14:31
Clean out a directory of git repositories
#!/bin/bash
for d in `find . -maxdepth 1 -type d`
do
pushd . > /dev/null
cd "$d"
echo "Trying $d"
if [ -d .git ]
then
git clean -fdx .
@michiel
michiel / pandoc.css
Created December 1, 2016 07:53 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@michiel
michiel / katharsis-custom-serializer.js
Created December 12, 2016 15:06
Ember data serializer changes to work with katharsis, thanks to @dfalling
import DS from 'ember-data';
export default DS.JSONAPISerializer.extend({
// This returns the key as-is to the model, instead of converting between a dasherized JSONAPI and a camelCased JS model.
keyForAttribute(key) {
return key;
},
keyForRelationship(key) {
return key;
@michiel
michiel / collect.sh
Created August 16, 2017 22:21
expect + ssh + scp with password to collect data from a list of servers
#!/bin/bash
PASSWORD="password"
USERNAME="username"
SSHPORT=22
@michiel
michiel / rust-update-docs-hook
Created September 21, 2017 22:34 — forked from Stebalien/rust-update-docs-hook
A post-commit hook to update a rust project's gh-pages.
#!/bin/bash
set -e
[[ "$(git symbolic-ref --short HEAD)" == "master" ]] || exit 0
msg() {
echo "> $@"
}
dir="$(pwd)"
tmp="$(mktemp -d)"
@michiel
michiel / .block
Last active November 16, 2017 02:11 — forked from mbostock/.block
Minimap Demo
license: gpl-3.0
@michiel
michiel / commands-fluent-bit-dev.md
Last active February 6, 2018 02:45
fluent-bit dev

Manage and update remote branches

git remote add upstream https://github.com/fluent/fluent-bit.git
git checkout -b ffscl-master
git remote add ffscl https://github.com/ffscl/fluent-bit.git
git fetch -v ffscl master
git branch --set-upstream-to=ffscl/master
git remote -v

Dev

@michiel
michiel / schema-introspection.graphql
Last active April 7, 2018 03:28
graphql schema introspection query
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
types {
...FullType
}
directives {
name
description
@michiel
michiel / pagination_example.sql
Created April 8, 2018 12:48 — forked from ssokolow/pagination_example.sql
Reasonably efficient pagination without OFFSET (SQLite version)
-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6
SELECT foo, bar, baz, quux FROM table
WHERE oid NOT IN ( SELECT oid FROM table
ORDER BY title ASC LIMIT 50 )
ORDER BY title ASC LIMIT 10