Skip to content

Instantly share code, notes, and snippets.

Avatar

Gabriel Fernandes gabrielfern

View GitHub Profile
@gabrielfern
gabrielfern / show_playlist.lua
Created Jan 29, 2020
mpv - Toggle playlist showing on screen
View show_playlist.lua
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 Jan 29, 2020
mpv - Move position of entry in playlist and remove entries from playlist
View playlist_operations.lua
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 Jan 25, 2020
Useful when using mpv with keep-open option, no loop and mpv-mpris
View seek0_on_eof.lua
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 Dec 31, 2019
Google Chrome extension to disable download bar that automatically appears when download is started
View background.js
chrome.runtime.onInstalled.addListener(() => {
chrome.downloads.setShelfEnabled(false)
})
chrome.runtime.onStartup.addListener(() => {
chrome.downloads.setShelfEnabled(false)
})
@gabrielfern
gabrielfern / report.html
Last active Nov 28, 2019
Previsão de resultados das partidas dos Campeonatos Europeus - profile
View report.html
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)
@gabrielfern
gabrielfern / sample_submission.csv
Created Nov 20, 2019
Previsão de resultados das partidas dos Campeonatos Europeus - datasets
View sample_submission.csv
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 Feb 24, 2020
Guessing Game
View index.html
<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 Oct 17, 2019
cartola test csv
View 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
View cartola_2014.csv
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
View income.csv
10 26.6588387834389
10.4013377926421 27.3064353457772
10.8428093645485 22.1324101716143
11.2441471571906 21.1698405046065
11.6454849498328 15.1926335164307
12.0869565217391 26.3989510407284
12.4882943143813 17.435306578572
12.8896321070234 25.5078852305278
13.2909698996656 36.884594694235
13.7324414715719 39.666108747637
You can’t perform that action at this time.