Skip to content

Instantly share code, notes, and snippets.

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
View create_m4a_tags.py
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 Nov 24, 2014
lisp/{custom,faces}.el: Partial revert of commit aac2b67
View 0001-lisp-custom-faces-.el-Partial-revert-of-commit-aac2b.patch
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 Apr 30, 2015
Doubly encoded URLs in coursera.
View funny.py
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 Jun 4, 2015
Output from tox on edx-downloader
View gist:59736ed280e569619e84
$ 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
View gist:462665
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$
View gist:471172
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 Oct 22, 2011
Generation of a TeX font with fontforge
View dejavubb.sty
%% 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 Nov 1, 2011 — forked from kinow/Euler1.java
Project Euler 1
View bruno.py
#!/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 Feb 10, 2012
Unittests before changes
View gist:1793354
# -*- coding: utf-8 -*-
import sys
import unittest
sys.path.append('src')
sys.path.append('../src')
from common import *
@rbrito
rbrito / Javascript.js
Created Feb 16, 2012
Proposal of changes for Javascript.js
View 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 () {