Skip to content

Instantly share code, notes, and snippets.

@fabianofa
fabianofa / nowhal.js
Created February 19, 2023 08:46 — forked from jziggas/nowhal.js
JavaScript to delete all of your Reddit comments
// Go to https://www.reddit.com/user/<username>/ and paste into your console.
// Reddit throttles these actions, hence the 1s timer.
let interval = setInterval(() => {
let deleteButtons = $('a.togglebutton[data-event-action="delete"]');
if (deleteButtons.length === 0) {
clearInterval(interval);
if ($('.next-button > a')[0]) {
$('.next-button > a')[0].click();
alert('Restart script.');
}
@fabianofa
fabianofa / disable-bixby.md
Created July 8, 2022 04:48 — forked from teocci/disable-bixby.md
How to disable/uninstall Bixby without root access

How to disable/uninstall Bixby without root access

Ever since Samsung announced the Galaxy S8 with its onboard assistant, Bixby, people have been asking for ways to disable it and forget the button ever existed in the first place. With the Galaxy S9 and Note 9, that chorus became even louder, and with the Galaxy S10 now available, a whole new generation of customers will be looking to disable Bixby.

Why do you want to disable Bixby?

One of the biggest frustrations with the Bixby button is its placement; the button is right under the volume keys and nearly directly opposite the power buttons. On larger phones like the Galaxy S9+ and Note 8, this often leads to accidental presses and unintended Bixby launches, especially when double-pressing the power button to launch the camera.

The Bixby button is also not mappable to another action; Samsung wants you to use it for Bixby, or not at all. This isn't ideal, so many people will inevitably choose to just forget it exists and move on.

While the hardware

@fabianofa
fabianofa / dkex.sh
Created September 12, 2019 11:35
Shell script como alias para rodar comando em um container em específico
#!/bin/bash
usage="$(basename "$0") [-h] [-w d e] -- script para executar um comando via docker exec -it
where:
-w diretório no container onde o comando será executado
-d nome do container, obtido via \$ docker ps
-e comando a ser executado. Caso o comando conter espaços deve estar envolto de aspas
exemplo de uso:
@fabianofa
fabianofa / randomLatitudeLongitude.php
Created August 25, 2016 18:33
Gera valor de latitude e longitude até uma determinada distância de um ponto inicial.
<?php
$randomCoordinated = function($x0, $y0, $radius){
$randomFloat = function($min = 0, $max = 1) {
return $min + mt_rand() / mt_getrandmax() * ($max - $min);
};
// Convert radius from meters to degrees
$radiusInDegrees = $radius / 111000;
@fabianofa
fabianofa / etc:init.d:memcached
Last active February 3, 2016 12:23
Running multiple instances of memcached installed via Yum or RPM on CentOS 6.x
#!/bin/bash
#
# Init file for memcached
#
# Written by Dag Wieërs <[email protected]>
#
# chkconfig: - 80 12
# description: Distributed memory caching daemon
#
# processname: memcached
@fabianofa
fabianofa / gist:8860987
Created February 7, 2014 11:21
PNG merge with alpha using GD
<?php
/**
* PNG ALPHA CHANNEL SUPPORT for imagecopymerge();
* by Sina Salek
*
* Bugfix by Ralph Voigt (bug which causes it
* to work only for $src_x = $src_y = 0.
* Also, inverting opacity is not necessary.)
* 08-JAN-2011
*