Skip to content

Instantly share code, notes, and snippets.

@Melindrea
Melindrea / .gitconfig
Created January 29, 2016 14:02 — forked from timdorr/.gitconfig
.gitconfig aliases
[alias]
st = status -sb
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
up = !git fetch origin && git rebase origin/master
mup = !git fetch origin && git merge origin/master
done = "!git checkout master && git pull && git fetch -p && git branch --merged | grep -Pv '\\*|master' | xargs -n 1 git branch -d"
@Melindrea
Melindrea / README.md
Last active December 4, 2015 17:10 — forked from renchap/README.md
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 {

Project organization

Here is how I prefer to organize projects:

┌─ _dist/
├─ assets/
├─ content/
├─ data/
@Melindrea
Melindrea / git-prompt.sh
Last active December 13, 2015 21:18 — forked from presstube/gist:1299452
Main update from the fork and the awesome post by opinionated programmer is that the default prompt is based on the Ubuntu one, and allows to show Python's virtual environment. Add the snippet to .bash_profile or .bashrc
# Snazzy git prompt
#http://www.opinionatedprogrammer.com/2011/01/colorful-bash-prompt-reflecting-git-status/
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ nothing\ to\ commit ]]; then
local ansi=42
elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
local ansi=43