Skip to content

Instantly share code, notes, and snippets.

@qgustavor
qgustavor / index.js
Last active February 17, 2016 16:54
Hummingbird to MAL
// This script tries to follow Standard Code Style
var fs = require('fs-extra')
var request = require('request')
.defaults({
headers: {
'User-Agent': 'Mozilla/5.0 (compatible; HummingSync/1.4.0-gist; +https://hummingbird.me/stories/5534175)'
}
})
var state = {
@qgustavor
qgustavor / if-do-while.js
Created March 11, 2016 12:18
From MEGA.nz source code: what?!
if (page.indexOf('%25') !== -1) {
do {
page = page.replace(/%25/g, '%');
} while (page.indexOf('%25') !== -1);
}
var romaji2katakana = (function() {
// based in http://d.hatena.ne.jp/mohayonao/20091129/1259505966
var romaji_dict = {
'a': 'ア', 'i': 'イ', 'u': 'ウ', 'e': 'エ', 'o': 'オ',
'ka': 'カ', 'ki': 'キ', 'ku': 'ク', 'ke': 'ケ', 'ko': 'コ',
'sa': 'サ', 'shi':'シ', 'su': 'ス', 'se': 'セ', 'so': 'ソ',
'ta': 'タ', 'chi':'チ', 'tu': 'ツ', 'te': 'テ', 'to': 'ト',
'na': 'ナ', 'ni': 'ニ', 'nu': 'ヌ', 'ne': 'ネ', 'no': 'ノ',
'ha': 'ハ', 'hi': 'ヒ', 'fu': 'フ', 'he': 'ヘ', 'ho': 'ホ',
'ma': 'マ', 'mi': 'ミ', 'mu': 'ム', 'me': 'メ', 'mo': 'モ',

Rank baseado na média simples das scores dadas pelos usuários que postaram as suas listas no tópico do MyAnimeList. Foram considerados apenas animes que mais de 10 usuários assistiram.

Rank Anime Score Média
1 Mushishi 9.615 ★★★★★★★★★★
2 Hajime no Ippo 9.545 ★★★★★★★★★★
3 Clannad: After Story 9.476 ★★★★★★★★★☆
4 Gintama': Enchousen 9.417 ★★★★★★★★★☆
5 Chihayafuru 2 9.353 ★★★★★★★★★☆
6 Fate/stay night: Unlimited Blade Works 2nd Season 9.333 ★★★★★★★★★☆
@qgustavor
qgustavor / KawaiiShoutbox.user.js
Last active September 23, 2017 18:38
Kawaii Shoutbox
// ==UserScript==
// @name Kawaii Shoutbox
// @namespace userscripts@グスタボ.tk
// @include https://tracker.uniotaku.com/shoutboxn.php
// @version 1.0.0
// @grant none
// ==/UserScript==
// Mude a URL como quiser:
var imageURL = 'https://i.imgur.com/JZGR3Tc.jpg';

The Tab Locking Problem

A certain web application is suffering problems caused by high server usage. In order to solve this I tried to implement tab locking, in other words, making that just one opened tab will send request to the server, while the others will just sincronize with this tab.

I tested three libraries:

  1. https://github.com/slimjack/IWC
@qgustavor
qgustavor / myanimelist-old.css
Created May 10, 2016 11:38
Some memories from my old Holo love
/* Old Oregairu style, simplified */
body{overflow-y:scroll;background:#e6e4ee;color:#337eb8;font:11px Verdana,sans-serif}#list_surround{width:920px;margin:0 auto}.form{color:#f11;font-size:11px;border-color:#ababab;border-style:solid;border-width:1px;padding:2px}.header_title{font-size:14px;background:#337eb8;display:inline-block;color:#FFF;position:relative;left:-3em;box-shadow:2px 2px 1px rgba(0,0,0,.2);bottom:-1em;font-weight:400;padding:.3em;text-transform:uppercase}#grand_totals{text-align:center}.table_header{opacity:0;transform: translateY(-50%)}.table_header a,.table_header a:hover{color:#fff}[cellspacing]:hover .table_header{opacity:1;background:#71335a;color:#fff;-webkit-transition:opacity .3s;transition:opacity .3s,transform .3s;transform:translateY(0)}.table_header:nth-child(2){text-align:center}.header_al{font-weight:700;font-size:16px}.animetitle{font-weight:700}#copyright{padding:6px;text-align:center;width:920px;margin:1em auto;font-size:1.25em;color:#fff;background:#337eb8}a,a:visited{color:
@qgustavor
qgustavor / index.html
Last active June 9, 2016 14:58
Big File Download Test
<!doctype html>
<title>Big File Download Test</title>
<p>Please wait: a Service Worker will be installed then the download will be started.</p>
<p>You can also download a <a href="big-audio.wav">big random wav audio file</a> or listen it below:</p>
<p><audio src="big-audio.wav" preload="none" controls></p>
<p id="error-output"></p>
<script>
navigator.serviceWorker.register('sw.js', {scope: '.'})
.then(() => {
location.href = './big-file.txt';
@qgustavor
qgustavor / fix-google-keep.user.js
Last active June 27, 2016 09:12
Restore extra column which got removed in the last Google Keep update
// ==UserScript==
// @name Fix Google Keep columns
// @namespace üsersçrì[email protected]
// @include https://keep.google.com/*
// @version 1.2
// @grant none
// @run-at document-start
// ==/UserScript==
var originalGetter = Object.getOwnPropertyDescriptor(Element.prototype, 'clientWidth').get;
@qgustavor
qgustavor / hide-google-keep-sidebar.user.js
Created June 2, 2016 11:18
Hide by default Google Keep Sidebar
// ==UserScript==
// @name Hide by default Google Keep Sidebar
// @namespace üsersçrì[email protected]
// @include https://keep.google.com/*
// @version 1
// @grant none
// @run-at document-idle
// ==/UserScript==
document.querySelector('[aria-label="Navigation Menu"]').click();