Skip to content

Instantly share code, notes, and snippets.

View jeffhorton's full-sized avatar

Jeff Horton jeffhorton

View GitHub Profile
@jeffhorton
jeffhorton / nginx.conf
Created July 31, 2018 03:11 — forked from hwdsl2/nginx.conf
Actual nginx.conf for Lin's Tech Blog (http://blog.ls20.com - click for tutorial). Published with Ghost, Nginx and ModSecurity
user nginx;
# Set this to match the number of CPU cores
worker_processes 2;
events { worker_connections 1024; }
http {
server_names_hash_bucket_size 64;
types_hash_max_size 2048;
server_tokens off;
include mime.types;
default_type application/octet-stream;
@jeffhorton
jeffhorton / Slack Hide User Bookmarklet
Last active December 29, 2017 18:25
Slack Hide User
javascript:(function(){window.rl = window.rl || []; function rlfunc() { $('span.message_sender, a.member').each(function (i, j) { for (var i = 0; i < window.rl.length; i++) { var re = new RegExp(rl[i], "ig"); if (j.className.match(re) || j.textContent.match(re)) { j.closest('ts-message').remove(); console.log('removing', re); } else { console.log('no match', re, j.className); } } } ) } var u = prompt('user partial'); if (u != null) { window.rl.push(u); console.log(window.rl); rlfunc() }; $('body').remove('DOMSubtreeModified', rlfunc()); $('body').on('DOMSubtreeModified', rlfunc());})();
@jeffhorton
jeffhorton / gist:bb4985c50ca3a7e6cca3aeeeccaf5fb6
Last active March 2, 2017 00:09
handy blocks copied from random places
in hn comments related to this https://blog.sentry.io/2017/03/01/dodging-s3-downtime-with-nginx-and-haproxy.html
Heads up a simple yet production ready NGINX location block to proxy to a public s3 bucket looks like:
# matches /s3/*
location ~* /s3/(.+)$ {
set $s3_host 's3-us-west-2.amazonaws.com';
set $s3_bucket 'somebucketname'
proxy_http_version 1.1;
proxy_ssl_verify on;