Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
❤️ not eating nor abusing animals 🍀

Daniel Hahler blueyed

💭
❤️ not eating nor abusing animals 🍀
View GitHub Profile
@chekunkov
chekunkov / pythonstartup.py
Last active Jan 19, 2017
PYTHONSTARTUP file example with custom displayhook
View pythonstartup.py
#!/usr/bin/env python
import sys
import pprint
def displayhook_pprint(o):
"""Display hook powered by pprint.
https://www.python.org/dev/peps/pep-0217/
@coderofsalvation
coderofsalvation / export_process
Last active May 14, 2020
updates an environment variable of a running process
View export_process
# updates an environment variable of a running process (needs sudo)
# example: sudo export_pid <variable=value> <pid>
export_process(){
script=/tmp/.gdb.$2
echo -e "attach $2\ncall putenv (\"$1\")\ndetach\n" > $script
gdb -q -batch -x $script &>/dev/null
rm $script
}
@tarruda
tarruda / gtk3-pyenv.sh
Created Jan 9, 2015
Install pygtk3 in pyenv
View gtk3-pyenv.sh
#!/bin/bash
# script for pyenv installation of pygtk3 in ubuntu 12.04
# Adapted from https://gist.github.com/mehcode/6172694
system_package_installed() {
if ! dpkg -l | grep -q $1; then
sudo apt-get install $1
fi
}
@brianclements
brianclements / Commit Formatting.md
Last active Oct 14, 2021
Angular Commit Format Reference Sheet
View Commit Formatting.md

Commit Message Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the Angular change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

View gist:8c25ed4abb36372bc6fe
" quick replace occurences
let g:should_inject_replace_occurences = 0
function! MoveToNext()
if g:should_inject_replace_occurences
call feedkeys("n")
call repeat#set("\<Plug>ReplaceOccurences")
endif
let g:should_inject_replace_occurences = 0
endfunction
@chmouel
chmouel / pan.zsh
Last active Jun 4, 2017
PAN: a zsh tool to switch easily with completion the tox virtualenvs and tests (demo: http://i.imgur.com/kJsJTjj.gif)
View pan.zsh
# Author: Chmouel Bodujnah <chmouel@chmouel.com>
#
# Pan a zsh tool to complete virtualenv tox targets and tests launched via
# testtools
#
# Demo: http://i.imgur.com/kJsJTjj.gif
#
# When you use zsh just source the file directly and when you are inside a
# project which has been pre-built with tox targets you can start do:
# pan <TAB>
View net_sniff_decorator.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import pcap #requires the python-libpcap module
def libpcap_net_data(cap_file, net_iface, filter_expr=None):
"""A decorator that can be used to sniff network data for the duration of a function call
if there is heavy traffic on the network interface the captured data will contain spurious packets
not related to the function call
View git-prompt.sh
# bash/zsh git prompt support
# # -*- encoding: utf-8 -*-
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
@bitjockey42
bitjockey42 / mopidy.md
Created Apr 20, 2014
An installation and setup guide for mopidy on Arch Linux.
View mopidy.md

Mopidy on Arch Linux

mopidy

Installation

Install from the AUR.

@soarez
soarez / ca.md
Last active Oct 16, 2021
How to setup your own CA with OpenSSL
View ca.md

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.