Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View rbrito's full-sized avatar
☹️
Having (YET another) kidney stone surgery in a few days...

Rogério Brito rbrito

☹️
Having (YET another) kidney stone surgery in a few days...
View GitHub Profile
import mutagen
tags = mutagen.File('foo.m4a')
tags # {'\xa9too': [u'Lavf55.33.100']}
tags['----:com.apple.iTunes:replaygain_track_gain'] = ['-10.44 dB']
tags # {'\xa9too': [u'Lavf55.33.100'], '----:com.apple.iTunes:replaygain_track_gain': ['-10.44 dB']}
tags.save()
@rbrito
rbrito / 0001-lisp-custom-faces-.el-Partial-revert-of-commit-aac2b.patch
Created November 24, 2014 21:45
lisp/{custom,faces}.el: Partial revert of commit aac2b67
From 124b8da812896eee004d9243122781118298f627 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
Date: Sun, 23 Nov 2014 16:45:12 -0200
Subject: [PATCH] lisp/{custom,faces}.el: Partial revert of commit aac2b67.
There were conflicts and I resolved them in the simplest (and most
naive) way, which is probably quite incorrect.
Still, this makes Emacs from master work back again for me.
---
@rbrito
rbrito / funny.py
Created April 30, 2015 12:50
Doubly encoded URLs in coursera.
import urllib
# Some silly people put invalid URLs like this:
#
# 'https://d396qusza40orc.cloudfront.net/webapplications/https%3A//d396qusza40orc.cloudfront.net/webapplications/lecture_slides/M6-L8-Ajax-Handout.pdf'
#
# as resources for students to download. We work around incompetence
# because, well, we are not like them.
s = 'https://d396qusza40orc.cloudfront.net/webapplications/https%3A//d396qusza40orc.cloudfront.net/webapplications/lecture_slides/M6-L8-Ajax-Handout.pdf'
@rbrito
rbrito / gist:59736ed280e569619e84
Created June 4, 2015 02:55
Output from tox on edx-downloader
$ tox
GLOB sdist-make: /home/rbrito/Desktop/cursos/edx-downloader/setup.py
py27 inst-nodeps: /home/rbrito/Desktop/cursos/edx-downloader/.tox/dist/edx-dl-0.0.zip
py27 runtests: PYTHONHASHSEED='3787261654'
py27 runtests: commands[0] | py.test -v --junitxml=/home/rbrito/Desktop/cursos/edx-downloader/.tox/py27/log/result.xml .
======================================================= test session starts ========================================================
platform linux2 -- Python 2.7.10 -- py-1.4.28 -- pytest-2.7.1 -- /home/rbrito/Desktop/cursos/edx-downloader/.tox/py27/bin/python2.7
rootdir: /home/rbrito/Desktop/cursos/edx-downloader, inifile:
collected 7 items
rbrito@chagas:/media/lutz/devel/xpdf-poppler$ git reflog show origin/debian
63d878b refs/remotes/origin/debian@{0}: update by push
ed1d718 refs/remotes/origin/debian@{1}: update by push
bf233f7 refs/remotes/origin/debian@{2}: update by push
de82975
rbrito@chagas:/media/lutz/devel/xpdf-poppler$
int mine(int n)
{
int i, sum = 0;
for (i = 1; i <= n; i++) {
sum += i^2/4;
}
return sum;
}
@rbrito
rbrito / dejavubb.sty
Created October 22, 2011 19:15
Generation of a TeX font with fontforge
%% Stolen from the bbold package.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{dejavubb}[2011/10/08 dejavubb package]
\newcommand{\bbfamily}{\fontencoding{T1}\fontfamily{dejavubb}\selectfont}
\newcommand{\textbb}[1]{{\bbfamily#1}}
\DeclareMathAlphabet{\mathbb}{T1}{dejavubb}{m}{n}
\endinput
@rbrito
rbrito / bruno.py
Created November 1, 2011 17:32 — forked from kinow/Euler1.java
Project Euler 1
#!/usr/bin/env python
import sys
if sys.platform == "win32":
from time import clock as default_timer
else:
from time import time as default_timer
def bruno(n):
@rbrito
rbrito / gist:1793354
Created February 10, 2012 22:03
Unittests before changes
# -*- coding: utf-8 -*-
import sys
import unittest
sys.path.append('src')
sys.path.append('../src')
from common import *
@rbrito
rbrito / Javascript.js
Created February 16, 2012 10:55
Proposal of changes for Javascript.js
/*
* iTunes Javascript Class, added to the displayed pages.
* Catches iTunes-api calls from pages, such as
* http://r.mzstatic.com/htmlResources/6018/dt-storefront-base.jsz
*/
/*global window */
iTunes = { // All called from the page js:
getMachineID: function () {