Skip to content

Instantly share code, notes, and snippets.

@marsam
marsam / magic_memit.py
Created June 30, 2012 19:55 — forked from vene/magic_memit.py
memit: magic memory usage benching for IPython
# Author: Vlad Niculae <vlad@vene.ro>
# Makes use of memory_profiler from Fabian Pedregosa
# available at https://github.com/fabianp/memory_profiler
from IPython.core.magic import Magics, line_magic, magics_class
@magics_class
class MemMagics(Magics):
@line_magic
@marsam
marsam / timer.py
Created June 30, 2012 13:15 — forked from cgoldberg/timer.py
Python Timer Class - Context Manager for Timing Code Blocks
#!/usr/bin/env python
#
# Python Timer Class - Context Manager for Timing Code Blocks
# Corey Goldberg - 2012
#
from timeit import default_timer
@marsam
marsam / baka.py
Created May 26, 2012 08:21
Baka Updates Crawler
#!/usr/bin/env python
from lxml.html import parse
def get_today_releases():
url = 'http://www.mangaupdates.com/releases.html'
root = parse(url).getroot()
today_rls = root.xpath("//div/div[2]//tr[position()>=2]")
releases = []
\documentclass[a4paper,10pt]{article}
%A Few Useful Packages
\usepackage{marvosym}
\usepackage{fontspec} %load fonts
\usepackage{url,parskip} %formatting
\usepackage{xunicode,xltxtra} %other packages for XeTeX
%Graphics - Colors
\RequirePackage{color,graphicx}
% ----------------------------------------------------------------------------------------%
% Created by Alessandro with TeXShop %
% ----> Sep 1, 2009 %
% Compiled with XeLaTeX, on Mac OS X 10.5 %
% Licensed under the Creative Commons Attribution 3.0 Unported %
% Share, change, spread, and have fun! %
% http://creativecommons.org/licenses/by/3.0/ %
% You can find more at http://cv-templates.info %
% ----------------------------------------------------------------------------------------%
@marsam
marsam / two-col-cv.tex
Created November 27, 2011 00:59
Two column cv
% ----------------------------------------------------------------------------------------%
% Created by Alessandro with TeXShop %
% ----> May 27, 2009 %
% Compiled with XeLaTeX, on Mac OS X %
% Licensed under the Creative Commons Attribution 3.0 Unported %
% Share, change, spread, and have fun! %
% http://creativecommons.org/licenses/by/3.0/ %
% You can find more at http://aleplasmati.comuv.com %
% ----------------------------------------------------------------------------------------%
@marsam
marsam / cv.tex
Created November 27, 2011 00:59
\documentclass[a4paper,10pt]{article}
%A Few Useful Packages
\usepackage{marvosym}
\usepackage{fontspec} %for loading fonts
\usepackage{xunicode,xltxtra,url,parskip} %other packages for formatting
\RequirePackage{color,graphicx}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[big]{layaureo} %better formatting of the A4 page
% an alternative to Layaureo can be ** \usepackage{fullpage} **
@marsam
marsam / steve_yegge.rst
Created November 9, 2011 21:27
Steve Yegge post

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall

@marsam
marsam / pi.py
Created September 6, 2011 13:41
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Estimation of Pi using the Mandlebrot set
http://en.wikipedia.org/wiki/Mandelbrot_set
http://code.activestate.com/recipes/577584-amazing-estimation-of-pi-using-the-mandlebrot-set/
https://home.comcast.net/%7Edavejanelle/mandel.pdf
"""
@marsam
marsam / rst2html.py
Created September 3, 2011 16:42
rst2html.py with source-code directive
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
A minimal front end to the Docutils Publisher, producing HTML.
Pygments: external/rst-directive.py
"""
try: