Skip to content

Instantly share code, notes, and snippets.

@tobiasvl
tobiasvl / install_aseprite.sh
Last active Feb 14, 2021
The commands to build aseprite on Fedora
View install_aseprite.sh
# Copied from https://github.com/aseprite/aseprite/blob/master/INSTALL.md#skia-on-linux
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 https://chromium.googlesource.com/chromium/tools/depot_tools.git
git clone -b aseprite-m71 https://github.com/aseprite/skia.git
export PATH="${PWD}/depot_tools:${PATH}"
cd skia
@dvgodoy
dvgodoy / draw_neural_net.py
Last active Sep 11, 2020
Draw neural network diagram with Matplotlib
View draw_neural_net.py
## 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.
:usage:
@patik
patik / how-to-squash-commits-in-git.md
Last active Jun 6, 2021
How to squash commits in git
View how-to-squash-commits-in-git.md

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
nicwolff / XML_breaker.py
Last active Jun 14, 2021
Python script to break large XML files
View XML_breaker.py
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
miguelmota / README.md
Last active May 14, 2021
Multiple accounts with Mutt E-Mail Client (gmail example)
View README.md

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

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@pascalpoitras
pascalpoitras / myweechat.md
Last active Jun 13, 2021
My always up-to-date WeeChat configuration (weechat-dev)
View myweechat.md

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
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
scvalex / pull_contacts.py
Created Jul 15, 2010
Pull data from Google Contacts
View pull_contacts.py
#!/usr/bin/python
"""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
http://code.google.com/apis/contacts/docs/1.0/developers_guide_python.html
"""
import atom