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 / uLabel.ahk
Last active September 9, 2015 23:40
uTorrent Regex Labeler
#Persistent
#SingleInstance,Force
#NoTrayIcon
DEBUG_ENABLED := false
TRACKER_SUPPORT := false
WINDOW_ADD_TORRENT := "Add New Torrent ahk_class #32770"
WINDOW_TORRENT_PROPERTIES := "Torrent Properties ahk_class #32770"
@GuilhermeHideki
GuilhermeHideki / print_path.sh
Last active January 19, 2016 22:20
Windows paths
echo %path% | tr ';' '\n' | sort
@GuilhermeHideki
GuilhermeHideki / source.discogs.sh
Last active July 26, 2017 22:35
cookbook.beets
# The 1º uniq is to reduce the data to the grep, because data_souce is at item's level
# The 2º uniq is because somehow I get duplicates
# Added the Album Artist to sort
beet ls -f "$data_source | $albumartist - $album ($year)" | uniq | grep Discogs | sort | uniq
@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"
@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))
<?php
function nota_final($notas, $dificuldade)
{
sort($notas);
array_pop($notas);
array_shift($notas);
return array_sum($notas) * $dificuldade;
}
@GuilhermeHideki
GuilhermeHideki / down.sh
Created September 28, 2016 00:56
HTTP_proxy
git config --global --unset http.proxy
@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 / 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 / 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 ;