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 / php71.sh
Created September 12, 2019 11:37
Script bash para executar comando em um container de php71
#
# uso: php71 /var/www/html/foo composer install
#
#!/bin/bash
path=$1
args=("$@")
unset args[0]
if [ -z "$path" ]
@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 / gist:ee15e7f00c285351f358e813b6f9deb0
Last active August 25, 2019 03:10
Ubuntu web-dev setup
echo "Adding apt-repositories, update apt libraries and installing apt-fast.\n"
add-apt-repository -y ppa:apt-fast/stable && add-apt-repository -y ppa:ondrej/php && add-apt-repository -y ppa:serge-rider/dbeaver-ce && apt update && apt -y install apt-fast apt-transport-https wget apt-transport-https ca-certificates curl gnupg-agent software-properties-common net-tools
echo "\nUpdating Packages\n"
apt-fast upgrade -y
echo "\nInstalling Apache2, PHP, Memcached, Git, Dbeaver, Python 3\n"
apt-fast install -y apache2 php7.3 php7.3-cli php7.3-xml php7.3-curl php7.3-gd php7.3-zip php7.3-mbstring php7.3-common php7.3-dev php7.3-pgsql php-memcached memcached git dbeaver-ce python3
echo "\nInstalling Composer\n"
@fabianofa
fabianofa / gist:8493c01e404639b3eaadc8333756dd96
Last active November 28, 2018 09:55
Compilando extensões Pecl com a versão certa do PHP
# São utilizadas dois bins para definir destino e parâmetros de compilação: /usr/bin/php-config e /usr/bin/phpize.
# Considerando que php7.1-dev e php7.2-dev estejam instalados, para confirmar que irá ser compilado para PHP 7.1:
# considerando que ppa:ondrej esteja instalado:
$ sudo apt install php7.1-dev php7.2-dev
$ sudo update-alternatives --set php-config /usr/bin/php-config7.1
$ sudo update-alternatives --set phpize /usr/bin/phpize7.1
$ sudo php-config
$ sudo phpize -v
@fabianofa
fabianofa / gist:5ed9f0ee9f1ea01f1a61c1260a6380ca
Last active September 13, 2017 18:36
Changing PHP cli version
$ sudo update-alternatives --set php /usr/bin/php5.6
Na 10, aonde ficam os repositórios, para os projetos que envolvem Santa Catarina foi adicionada a configuração de atualização automática do repositório depois de cada push. A configuração fica no diretório respectivo, em `/Development/repos/<diretorio>.git/hooks`. O arquivo se chama `post-receive`. Caso nunca tenha sido alterada a configuração, o arquivo vai se chamar `post-receive.sample`. Caso seja preciso configurar:
* Acessa o diretório do repositório na 10 via terminal. Ex: `$ cd /Development/repos/SadeApplicationPMSC.git`
* Acessa o diretório `hooks`
* `$ mv post-receive.sample post-receive`
* `$ vim post-receive`
* Na próxima linha abaixo dos comentários cola a linha alterando o nome do repositório corretamente: `cd /Development/repos/SadeApplicationPMSC.git && git update-server-info`
* `:wq`
Após o próximo push, quando for necessário realizar pull em ambiente que clonou via HTTP não será mais necessário previamente acessar a 10 e atualizar o repositório via `git update-server-info`.
@fabianofa
fabianofa / gist:98b989c739a5290b8d8f8d64ee781211
Created March 6, 2017 10:55
Instalando extensão em ambiente linux com php já compilado
If you already have php installed (from repository for example), you can compile only the PDO_OCI from PHP source (you need the instantclient installed)
Download the PHP source with same version that you have installed;
Unzip;
Change to directory php-YOUR-VERSION/ext/pdo_oci
Inside the pdo_oci folder, run these commands:
$ git clone https://github.com/php/php-src.git
$ cd php-src
@fabianofa
fabianofa / gist:c25ddff393b7a98eff039090932ac884
Created November 29, 2016 14:02
Solving rsync on path and vboxsf not found for Vagrant on Windows
// on Vagrantfile:
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
// then:
vagrant plugin install vagrant-vbguest