Skip to content

Instantly share code, notes, and snippets.

@gabrielfern
gabrielfern / google-10000-english.txt
Last active August 7, 2022 01:50
Get a random word from the 10k most used english words (word list from https://github.com/first20hours/google-10000-english)
the
of
and
to
a
in
for
is
on
that
@gabrielfern
gabrielfern / show_playlist.lua
Created January 29, 2020 06:36
mpv - Toggle playlist showing on screen
local timer
local show_playlist = false
function draw_playlist()
mp.osd_message('')
mp.set_osd_ass(0, 0, '')
mp.commandv('script-message', 'osc-playlist')
end
function toggle_show_playlist()
@gabrielfern
gabrielfern / playlist_operations.lua
Last active January 29, 2020 14:07
mpv - Move position of entry in playlist and remove entries from playlist
function notify_new_pos(pos, count)
mp.osd_message('New position in playlist ['.. pos ..'/'..count..']')
mp.msg.info('New position in playlist ['.. pos ..'/'..count..']')
end
function move_up()
local pos = mp.get_property_number('playlist-pos')
local count = mp.get_property_number('playlist-count')
if pos >= 1 then
@gabrielfern
gabrielfern / seek0_on_eof.lua
Created January 25, 2020 01:29
Useful when using mpv with keep-open option, no loop and mpv-mpris
function on_eof(name, value)
if value == true then
mp.set_property("playback-time", 0)
end
end
mp.observe_property("eof-reached", "bool", on_eof)
@gabrielfern
gabrielfern / background.js
Created December 31, 2019 15:51
Google Chrome extension to disable download bar that automatically appears when download is started
chrome.runtime.onInstalled.addListener(() => {
chrome.downloads.setShelfEnabled(false)
})
chrome.runtime.onStartup.addListener(() => {
chrome.downloads.setShelfEnabled(false)
})
@gabrielfern
gabrielfern / report.html
Last active November 28, 2019 01:06
Previsão de resultados das partidas dos Campeonatos Europeus - profile
This file has been truncated, but you can view the full file.
<!doctype html><html lang=en><head><meta charset=utf-8><meta name=viewport content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name=description content="Profile report generated with the `pandas-profiling` Python package"><meta name=author content="Jos Polfliet, Simon Brugman and the open source community."><meta name=generator content="Pandas Profiling 2.3.0"><meta name=url content=https://github.com/pandas-profiling/pandas-profiling><title>Pandas Profiling Report</title><style>
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}a
@gabrielfern
gabrielfern / sample_submission.csv
Created November 20, 2019 21:23
Previsão de resultados das partidas dos Campeonatos Europeus - datasets
ID Result
GER090916#0 0
GER100916#0 1
GER100916#1 2
GER100916#2 0
GER100916#3 1
GER100916#4 2
GER100916#5 0
GER110916#0 1
GER110916#1 2
@gabrielfern
gabrielfern / index.html
Last active February 24, 2020 04:38
Guessing Game
<html>
<head>
<title>Guessing Game</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<style>
@import url('https://fonts.googleapis.com/css?family=Nunito&display=swap');
body {
margin: 0px;
@gabrielfern
gabrielfern / test.csv
Created October 17, 2019 02:39
cartola test csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 33 columns, instead of 8. in line 9.
atleta_id,rodada,clube_id,participou,posicao_id,jogos_num,pontos_num,media_num,preco_num,variacao_num,partida_id,mando,titular,substituido,tempo_jogado,FS,PE,A,FT,FD,FF,G,I,PP,RB,FC,GC,CA,CV,SG,DD,DP,GS
68873,37,262.0,1,1.0,29,10.1,4.81,9.88,0.22,180166.0,1,1.0,0,1.0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0
78086,37,262.0,0,1.0,0,0.0,0.0,2.0,0.0,180166.0,1,0.0,0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
89258,37,262.0,0,1.0,0,0.0,0.0,1.0,0.0,180166.0,1,0.0,0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
37701,37,262.0,1,2.0,33,1.7,2.82,10.09,0.26,180166.0,1,1.0,1,0.5,0,1,0,0,0,0,0,0,0,0,2,0,1,0,1,0,0,0
50453,37,262.0,1,2.0,8,10.0,7.2,6.15,1.55,180166.0,1,0.0,1,0.5,0,1,0,0,0,1,0,0,0,3,1,0,0,0,1,0,0,0
69177,37,262.0,0,2.0,3,0.0,2.4,4.18,0.0,180166.0,1,0.0,0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
71602,37,262.0,1,2.0,27,5.4,3.47,6.47,0.82,180166.0,1,1.0,0,1.0,2,6,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0
68958,37,262.0,1,3.0,31,7.5,3.67,15.31,1.48,180166.0,1,1.0,0,1.0,2,3,0,0,0,0,0,0,0,2,2,0,0,0,1,0,0,0
74103,37,262.0,0,3.0,0,0.0,0.0
We can't make this file beautiful and searchable because it's too large.
atleta_id,rodada,clube_id,participou,posicao_id,jogos_num,pontos_num,media_num,preco_num,variacao_num,partida_id,mando,titular,substituido,tempo_jogado,nota,FS,PE,A,FT,FD,FF,G,I,PP,RB,FC,GC,CA,CV,SG,DD,DP,GS
37958,1,262.0,1,1.0,1,8.0,8.0,19.69,1.69,179872.0,1,1.0,0,1.0,6.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0
68873,1,262.0,0,1.0,0,0.0,0.0,4.0,0.0,179872.0,1,0.0,0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
37701,1,262.0,1,2.0,1,0.4,0.4,16.97,-5.03,179872.0,1,1.0,0,1.0,6.0,0,7,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0
71602,1,262.0,0,2.0,0,0.0,0.0,3.0,0.0,179872.0,1,0.0,0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
37684,1,262.0,1,3.0,1,9.1,9.1,10.68,5.68,179872.0,1,1.0,0,1.0,6.0,2,1,0,0,1,0,0,1,0,2,1,0,0,0,1,0,0,0
68958,1,262.0,1,3.0,1,6.3,6.3,15.38,1.38,179872.0,1,1.0,0,1.0,6.0,1,1,0,0,0,1,0,0,0,2,2,0,1,0,1,0,0,0
81223,1,262.0,0,3.0,0,0.0,0.0,4.0,0.0,179872.0,1,0.0,0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
38311,1,262.0,1,4.0,1,3.0,3.0,7.57,0.57,179872.0,1,1.0,0,1.0,6.0,2,3,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,0
50301,1,262.0,1