Skip to content

Instantly share code, notes, and snippets.

// DEPENDS ON CRYPTO JS
// Compatible with App Script, Node/io and Browser environments
// COMMON BLOCK
function base64urldecode(data) {
data += '=='.substr((2 - data.length * 3) & 3);
data = data.replace(/\-/g, '+').replace(/_/g, '/').replace(/,/g, '');
if (typeof Utilities !== 'undefined') {
// Apps Script:
return Utilities.base64Decode(data).map(function (e) {
// Change from Int8Array to Uint8Array then to String
var ss = SpreadsheetApp.openById('Your spreadsheet id');
function doPost(e) {
var returnedData = {};
// Retrieve and process any URL parameters, as necessary.
var data = e.parameter.data;
try {
addRow(data);
returnedData.result = 'OK';
@qgustavor
qgustavor / shoutbox.js
Last active September 3, 2015 15:56
Sugestões de Mudança para a Shoutbox
// ==UserScript==
// @name Sugestões de Mudança para a Shoutbox
// @version 1.5.17
// @grant none
// @include data:text/plain,sistema_implementado,_userscript_desativado
// @updateURL https://rawgit.com/qgustavor/fc66dc1aa54c2c3a9970/raw/shoutbox.js
// @downloadURL https://rawgit.com/qgustavor/fc66dc1aa54c2c3a9970/raw/shoutbox.js
// ==/UserScript==
// Coisas a fazer:
@qgustavor
qgustavor / batch-messages.user.js
Last active October 1, 2019 03:11
Batch Messages on WhatsApp Web
// ==UserScript==
// @name Batch Messages on WhatsApp Web
// @namespace [email protected]
// @include https://web.whatsapp.com/
// @version 1
// @grant unsafeWindow
// ==/UserScript==
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //
// Disclaimer: WhatsApp is banning people who use this //
@qgustavor
qgustavor / MEGA-FS.js
Last active September 30, 2015 20:19
MEGA FS wrapper for Apps Script
// The returns a object similar to the returned by DriveApp.getFolderById(id):
function getFolder_(id) {
var parts = id.split('!');
if (parts.length === 2 || id.length === 8) {
var result = UrlFetchApp.fetch('https://eu.api.mega.co.nz/cs?n=' + parts[0], {
method: 'POST',
contentType: 'application/json;charset=UTF-8',
payload: '[{"a":"f","c":1,"r":1}]'
});
// ==UserScript==
// @name Accessible Read State on WhatsApp
// @namespace [email protected]
// @include https://web.whatsapp.com/
// @version 1.0.1
// @grant none
// ==/UserScript==
(function (){
var style = document.createElement('style');
@qgustavor
qgustavor / instruções.md
Last active November 26, 2015 17:36
Chave personalizada para pasta do MEGA

Introdução:

Para alterar a chave do MEGA deve-se alterar a função dele responsável por gerar as chaves das pastas. A função por padrão usa valores aleatórios, porém ela será alterada para usar valores definidos.

Instruções:

Para utilizar deve-se abrir o console JavaScript presente nas ferramentas de desenvolvedor. Essas são geralmente abertas com a tecla de atalho F12

@qgustavor
qgustavor / autodown.py
Last active May 3, 2022 00:57
HexChat addon for XDCC download automation
#!/usr/bin/env python
from __future__ import print_function
import hexchat
__module_name__ = "AutoDown"
__module_version__ = "0.1"
__module_description__ = "Automates XDCC downloads"
print("\0034", __module_name__, __module_version__, " is loaded\003")
let normalize = e => e.toLowerCase().match(/\w/g).sort().join('')
let animes = /* paste the result from https://hummingbird.me/api/v1/users/[username]/feed here
where [username] is someone which watched many animes */
animeNames = animes
.reduce((a,e) => a.concat([e.anime.title, e.anime.alternate_title]), [])
.filter(e => e)
let n = normalize('some anagram')
@qgustavor
qgustavor / index.html
Last active February 4, 2016 21:49 — forked from darwin/index.html
O que é ratio?
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">