I hereby claim:
- I am hq063 on github.
- I am hq063 (https://keybase.io/hq063) on keybase.
- I have a public key ASCU8LNHXGWQDK-J8DJDYxs0swzrRBbH0pRf5GGSzJy0Ywo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | |
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script> | |
<!--<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>--> | |
<script src="https://cdn.jsdelivr.net/npm/papaparse@5.1.1/papaparse.min.js" integrity="sha256-X3LxH9hl4jSRLdC8GsHBNuT97cVgZed+NBsZwW/J5wI=" crossorigin="anonymous"></script> | |
<script> | |
// Population (manually built from https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population) |
// ==UserScript== | |
// @name Subtitulos! | |
// @namespace evolution9 | |
// @description Boton para bajar subtitulos en trakt.tv | |
// @include https://trakt.tv/dashboard | |
// @include https://trakt.tv/users/hq063/progress/watched/activity | |
// @version 1 | |
// @grant none | |
// @run-at document-idle | |
// ==/UserScript== |
// ==UserScript== | |
// @name BGG Quickbar | |
// @namespace hq063 | |
// @include https://boardgamegeek.com/ | |
// @include https://boardgamegeek.com/* | |
// @include https://www.boardgamegeek.com/ | |
// @include https://www.boardgamegeek.com/* | |
// @version 1 | |
// @grant GM_getValue | |
// @grant GM_setValue |
class IO | |
def tail(n) | |
return [] if n < 1 | |
if File.size(self) < ( 1 << 16 ) | |
tail_buf_length = File.size(self) | |
return self.readlines.reverse[0..n-1] | |
else | |
tail_buf_length = 100 | |
end | |
self.seek(-tail_buf_length,IO::SEEK_END) |
// ==UserScript== | |
// @name QR Itunes | |
// @namespace hq063 | |
// @include https://itunes.apple.com/app/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
$(function() { | |
$("body").append("<img src='https://api.qrserver.com/v1/create-qr-code/?size=200x200&data="+window.location.href+"' style='display: block; background: red; width: 200px; height: 200px; top: 80px; left: 10px; position: absolute;'>") |
def benchmark(times) | |
dt = DateTime.now | |
times.times do |j| | |
yield | |
end | |
puts ((DateTime.now - dt) * 24 * 60 * 60).to_f.to_s + " seconds" | |
end |
class MultipleCallback | |
def initialize(block) | |
@callbacks = Hash.new | |
block.call self | |
end | |
def on(symbol, &block) | |
@callbacks[symbol] = block | |
end |
irb(main):043:0> average_ratings = Hash.new{ |hash, key| hash[key] = { :average_rating => 0, :number_of_voters => 0 } } | |
=> {} | |
irb(main):044:0> average_ratings.has_key?(:lala) | |
=> false | |
irb(main):045:0> average_ratings[:lala] | |
=> {:average_rating=>0, :number_of_voters=>0} | |
irb(main):046:0> average_ratings.has_key?(:lala) | |
=> true | |
irb(main):048:0> average_ratings = Hash.new( { :average_rating => 0, :number_of_voters => 0 } ) |