Skip to content

Instantly share code, notes, and snippets.


Adrian Lanzafame lanzafame

View GitHub Profile
View wide-github-prs.css
Remove from this comment when putting the css into Stylus
url regex: /^https?://github\.com/.+?/pull/.*/files.*$/
@media only screen and (min-width: 1900px) {
.file {
width: 1500px;
margin-left: -250px;

Keybase proof

I hereby claim:

  • I am lanzafame on github.
  • I am lanzafame ( on keybase.
  • I have a public key whose fingerprint is 3698 5E8D 36C5 FDE9 D463 45D1 87E4 0C5D 62EA E192

To claim this, I am signing this object:

function __git_fzf_is_in_git_repo
command -s -q git
and git rev-parse HEAD >/dev/null 2>&1
function __git_fzf_git_status
__git_fzf_is_in_git_repo; or return
git -c color.status=always status --short | \
fzf -m --ansi --preview 'git diff --color=always HEAD -- {-1} | head -500' | \
cut -c4- | \
View blockstack
Verifying my Blockstack ID is secured with the address 15Tx5vaUVL2oMSW3ygWXxBdTNaQjTjQWCE
View blockstack
Verifying my Blockstack ID is secured with the address 15Tx5vaUVL2oMSW3ygWXxBdTNaQjTjQWCE
lanzafame / error output - ipfs
Last active Mar 15, 2018
Docker build gx issues (MacOS)
View error output - ipfs
$ docker build .
gx install --global
/bin/sh: 1: gx: Exec format error
mk/ recipe for target 'gx-deps' failed
make: *** [gx-deps] Error 2
The command '/bin/sh -c cd $SRC_DIR && mkdir .git/objects && ([ -z "$GX_IPFS" ] || echo $GX_IPFS > /root/.ipfs/api) && make build' returned a non-zero code: 2
lanzafame /
Last active Jul 11, 2016 — forked from un-def/
Toggle network connection up/down using nmcli
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import subprocess
if len(sys.argv) < 2:
print("Usage: connection_id")
conn_id = sys.argv[1]
active = subprocess.check_output(['nmcli', 'connection', 'show', '--active'])
up_down = ('up', 'down')[bytes(conn_id, 'utf-8') in active]
lanzafame / check.go
Last active Jun 17, 2016 — forked from mattes/check.go
Check if file or directory exists in Golang
View check.go
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
if _, err := os.Stat("/path/to/whatever"); err == nil {
// path/to/whatever exists
lanzafame /
Created Jun 15, 2016 — forked from piscisaureus/
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

lanzafame /
Created Jun 14, 2016 — forked from ibeex/
Python LDAP (ActiveDirectory) authentication
import ldap
def check_credentials(username, password):
"""Verifies credentials for username and password.
Returns None on success or a string describing the error on failure
# Adapt to your needs
LDAP_SERVER = 'ldap://xxx'
# fully qualified AD user name
LDAP_USERNAME = '%s@xxx.xx' % username