Skip to content

Instantly share code, notes, and snippets.

@l4sh
l4sh / nginx.conf
Created January 7, 2019 03:45 — 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
@l4sh
l4sh / python_decorator_guide.md
Created December 3, 2018 01:39 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@l4sh
l4sh / ansible-bootstrap-ubuntu-16.04.yml
Created April 11, 2018 01:59 — forked from gwillem/ansible-bootstrap-ubuntu-16.04.yml
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@l4sh
l4sh / init.el
Created April 11, 2016 17:43 — forked from matthewmccullough/init.el
Customize Markdown and Org-Mode Font Faces on Aquamacs Emacs
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Customize Font Faces
;; http://www.emacswiki.org/emacs/CustomizingFaces
(custom-set-faces
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(markdown-header-face-1 ((t (:inherit markdown-header-face :height 2.2))))
'(markdown-header-face-2 ((t (:inherit markdown-header-face :height 1.7))))
'(markdown-header-face-3 ((t (:inherit markdown-header-face :height 1.3))))
'(org-level-1 ((t (:inherit org-level-1 :height 1.5))))
@l4sh
l4sh / bobp-python.md
Created March 25, 2016 14:55 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@l4sh
l4sh / springer-free-maths-books.md
Created December 28, 2015 21:55 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links