Skip to content

Instantly share code, notes, and snippets.

View GuilhermeHideki's full-sized avatar

Guilherme Danno GuilhermeHideki

  • Somos Educação / Plurall
  • São Paulo, Brazil
View GitHub Profile
@GuilhermeHideki
GuilhermeHideki / artists.py
Last active August 4, 2021 03:58
Beets plugin for artists
# coding=utf-8
"""Update library's tags using MusicBrainz.
"""
from beets.plugins import BeetsPlugin
from beets import ui, util
from beets.autotag.mb import musicbrainzngs
from beets.autotag import hooks
from collections import defaultdict
@GuilhermeHideki
GuilhermeHideki / install.sh
Created May 6, 2018 15:13 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
<?php
/**
* @author Rafael Azenha Aquini <rafael@tchesoft.com>
* @author Marco Antonio Righi <marcorighi@tchesoft.com>
* @author Marcelo Belinato <mbelinato@gmail.com>
*
* @license GPL
*/
// +----------------------------------------------------------------------+
// | BoletoPhp - Versão Beta |
@GuilhermeHideki
GuilhermeHideki / paisesPortuguesIngles.sql
Created June 28, 2017 20:13 — forked from thiagosilr/paisesPortuguesIngles.sql
Tabela MYSQL com o nome de todos os países em Português / Inglês
--
-- Estrutura da tabela `pais`
--
CREATE TABLE IF NOT EXISTS `pais` (
`paisId` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
`paisNome` varchar(50) NOT NULL,
`paisName` varchar(50) NOT NULL,
PRIMARY KEY (`paisId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=253 ;
@GuilhermeHideki
GuilhermeHideki / test.tex
Created May 23, 2017 13:34
column example
% Antes do document
\usepackage{array}
% Colunas para left, right e middle
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\begin{tabular}{ |p{.25\textwidth}||L{.25\textwidth}||M{.25\textwidth}||R{.25\textwidth}|}
\hline
@GuilhermeHideki
GuilhermeHideki / _bs_callout.scss
Created December 29, 2016 19:24
SCSS Bootstrap callout
.bs-callout {
padding: 20px;
margin: 20px 0;
border: 1px solid #eee;
border-left-width: 5px;
border-radius: 3px;
h4 {
margin-top: 0;
margin-bottom: 5px;
@GuilhermeHideki
GuilhermeHideki / down.sh
Created September 28, 2016 00:56
HTTP_proxy
git config --global --unset http.proxy
<?php
function nota_final($notas, $dificuldade)
{
sort($notas);
array_pop($notas);
array_shift($notas);
return array_sum($notas) * $dificuldade;
}
@GuilhermeHideki
GuilhermeHideki / coalesce.py
Created April 27, 2016 07:31
Python coalesce
def coalesce(*args):
"""Returns the first not None item. Similar to ?? in C#.
It's different from a or b, where false values are invalid.
:param args: list of items for checking
:return the first not None item, or None
"""
return next((arg for arg in args if arg is not None))
@GuilhermeHideki
GuilhermeHideki / main.py
Created March 29, 2016 12:01
toying with OrientDB to build a genre graph from a YAML file
import pyorient
import yaml
import os, sys, codecs
def cp65001(name):
if name.lower()=='cp65001':
return codecs.lookup('utf-8')
codecs.register(cp65001)
os.environ["PYTHONIOENCODING"] = "cp65001"