Skip to content

Instantly share code, notes, and snippets.

View xgarrido's full-sized avatar

Xavier Garrido xgarrido

View GitHub Profile
@huyng
huyng / matplotlibrc
Created February 8, 2011 15:50
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).
@areina
areina / emacs-email-setup.md
Created October 12, 2012 15:00
Manage your email in emacs with mu4e

Manage your gmail account in emacs with mu4e

There're a lot of combinations to manage your email with emacs, but this works for me. I've a backup and I can manage my daily email.

The stack:

  • emacs
  • offlineimap
  • mu
  • mu4e
@klange
klange / _.md
Last active May 23, 2024 13:45
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
@RhysU
RhysU / gist:5281465
Last active March 18, 2021 11:35
Using Boost Spirit 2.1+ to evaluate constant arithmetic expressions. See http://agentzlerich.blogspot.com/2011/06/using-boost-spirit-21-to-evaluate.html
//--------------------------------------------------------------------------
//
// Copyright (C) 2011, 2012, 2013 Rhys Ulerich
// Copyright (C) 2012, 2013 The PECOS Development Team
// Please see http://pecos.ices.utexas.edu for more information on PECOS.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
@whalliburton
whalliburton / ssh-keys.el
Created July 10, 2013 16:47
While keeping long standing emacs sessions on remote machines nside terminal multiplexers such as 'screen' and 'tmux', the SSH_AUTH_SOCK environment variable of the emacs process becomes stale after disconnection and reconnection. The interactive function SET-SSH-AGENT-SOCKET below allows for a quick and dirty way to automatically reset this var…
;; ssh-keys.el
;; While keeping long standing emacs sessions on remote machines
;; inside terminal multiplexers such as 'screen' and 'tmux', the
;; SSH_AUTH_SOCK environment variable of the emacs process becomes
;; stale after disconnection and reconnection. The interactive
;; function SET-SSH-AGENT-SOCKET below allows for a quick and dirty
;; way to automatically reset this variable to the latest incoming SSH
;; agent authorization socket.
@grantslatton
grantslatton / hngen.py
Last active September 27, 2021 11:07
A program that uses Markov chains to generate probabilistic Hacker News titles.
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
@krishnakummar
krishnakummar / donut-example.py
Created September 11, 2015 11:56
Donut chart using python matplotlib
import matplotlib.pyplot as plt
# The slices will be ordered and plotted counter-clockwise.
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = [15, 30, 45, 10]
colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral']
explode = (0, 0, 0, 0) # explode a slice if required
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.1f%%', shadow=True)
@mwaskom
mwaskom / seaborn_dark_background.ipynb
Created December 3, 2015 19:49
Use seaborn with a dark background, if you like that sort of thing.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfm
dfm / betterstep.py
Last active March 1, 2023 18:49
A 'better' step function for matplotlib
import matplotlib.pyplot as plt
def betterstep(bins, y, **kwargs):
"""A 'better' version of matplotlib's step function
Given a set of bin edges and bin heights, this plots the thing
that I wish matplotlib's ``step`` command plotted. All extra
arguments are passed directly to matplotlib's ``plot`` command.
Args:
@rumansaleem
rumansaleem / clean-up-arch-linux.md
Created May 28, 2019 08:51
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks