Skip to content

Instantly share code, notes, and snippets.

View dAnjou's full-sized avatar
🔚
Moving to GitLab

Max Ludwig dAnjou

🔚
Moving to GitLab
View GitHub Profile
@dAnjou
dAnjou / _README_.md
Last active August 29, 2015 14:04
Testing import of Excel files

Usage

Run like this for example:

python2 excel_test.py | column -t

Output should look like this:

first_name   last_name  email                     gender
Salomé 笑薇 rjenkins@linktype.com Ms.
@elithrar
elithrar / authserver.go
Last active June 30, 2021 07:12
HTTP Basic Auth example in Go (based on http://stackoverflow.com/a/21937924/556573 + bespoke middleware implementation)
package main
import (
"encoding/base64"
"github.com/gorilla/mux"
"net/http"
"strings"
)
func main() {
@mwhite
mwhite / git-aliases.md
Last active April 30, 2024 11:32
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@dAnjou
dAnjou / _error_
Created July 22, 2012 20:41
Flask: circular import problem
Traceback (most recent call last):
File "server.py", line 8, in <module>
from models import User
File "/home/max/Projekte/flask-testing-stuff/models.py", line 1, in <module>
from server import db
File "/home/max/Projekte/flask-testing-stuff/server.py", line 8, in <module>
from models import User
ImportError: cannot import name User
@dAnjou
dAnjou / flask-upload
Created June 5, 2012 12:35
Flask upload example
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
@dAnjou
dAnjou / gitted.sh
Last active October 5, 2015 19:37
Script to find Git repos and show their status
#!/bin/bash
find "$@" -type d -name ".git" -execdir bash -c '
if [ ! $(git status | grep -o nothing) ]
then
x=$(basename "$PWD")
y=$(dirname "$PWD")
origin_url=$(git config --get remote.origin.url)
echo -e "\e[1;32m${x}\e[0m (${y}) ${origin_url}" >&2
git status -s >&2