Skip to content

Instantly share code, notes, and snippets.

tobiasvl /
Last active Feb 14, 2021
The commands to build aseprite on Fedora
# Copied from
sudo yum install -y gcc-c++ cmake ninja-build libX11-devel libXcursor-devel mesa-libGL-devel fontconfig-devel
mkdir $HOME/deps
cd $HOME/deps
git clone
git clone -b aseprite-m71
export PATH="${PWD}/depot_tools:${PATH}"
cd skia
dvgodoy /
Last active Sep 11, 2020
Draw neural network diagram with Matplotlib
## Gist originally developed by @craffel and improved by @ljhuang2017
import matplotlib.pyplot as plt
import numpy as np
def draw_neural_net(ax, left, right, bottom, top, layer_sizes, coefs_, intercepts_, n_iter_, loss_):
Draw a neural network cartoon using matplotilb.
patik /
Last active Jun 6, 2021
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

nicwolff /
Last active Jun 14, 2021
Python script to break large XML files
import os
import sys
from xml.sax import parse
from xml.sax.saxutils import XMLGenerator
class CycleFile(object):
def __init__(self, filename):
self.basename, self.ext = os.path.splitext(filename)
self.index = 0
miguelmota /
Last active May 14, 2021
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg


Directories and files

pascalpoitras /
Last active Jun 13, 2021
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

You need at least WeeChat 3.2-dev

Enable mouse

/mouse enable
View helloworld.js
var serialport = require('node-serialport')
var sp = new serialport.SerialPort("/dev/ttyO3", {
parser: serialport.parsers.raw,
baud: 9600
sp.on('data', function(chunk) {
console.log(chunk.toString('hex'), chunk.toString(), chunk)
alanbriolat / default.conf
Created Sep 28, 2011
nginx userdir + PHP-FPM
View default.conf
server {
listen 80;
server_name localhost;
# ... other default site stuff, document root, etc. ...
location ~ ^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ {
alias /home/$userdir_user/public_html$userdir_uri;
index index.html index.htm index.php;
autoindex on;
scvalex /
Created Jul 15, 2010
Pull data from Google Contacts
"""Module for pulling contacts out of Google and storing them to disk
(or something).
See the official guide for a more in-depth look at GData Python
import atom