Skip to content

Instantly share code, notes, and snippets.

View BrunoTorresF's full-sized avatar

Bruno Torres BrunoTorresF

  • Mexico City, MX
View GitHub Profile
@BrunoTorresF
BrunoTorresF / firefox-beta.desktop
Last active June 26, 2021 20:48
Linux shortcut for Firefox Nightly
[Desktop Entry]
Version=1.0
Name=Firefox Beta
Comment=Browse the World Wide Web
GenericName=Web Browser
X-GNOME-FullName=Firefox Beta Web Browser
Exec=/opt/firefox-beta/firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
const { extractText } = require('doxtract');
if (process.argv.length <= 2) {
console.log(`Usage: ${__filename} path/to/doc`);
process.exit(-1);
}
const doc = process.argv[2];
function countWords(text) {
@BrunoTorresF
BrunoTorresF / countDirFileNameOccurances.js
Created March 21, 2019 00:18
Counts file name occurances in directory [WIP]
const fs = require('fs');
if (process.argv.length <= 2) {
console.log('Usage: ' + __filename + ' path/to/directory');
process.exit(-1);
}
const path = process.argv[2];
fs.readdir(path, (err, items) => {
@BrunoTorresF
BrunoTorresF / PC-clean.sh
Last active January 10, 2019 00:17
shell script to delete all user files and folders, uninstall Spotify, and reset Unity settings (Ubuntu 16)
#!/bin/sh
# delete local user files and empty trash
find /home/$USER/* -maxdepth 1 \! \( -name Documents -o -name Pictures -o -name Music -o -name Downloads -o -name Desktop -o -name Videos -o -name Public -o -name '\.*' -o -name Templates -o -name Examples -o -name Public \) -exec sudo rm -rf '{}' \;
sudo rm -rf /home/$USER/Documents/* /home/$USER/Pictures/* /home/$USER/Music/* /home/$USER/Downloads/* /home/$USER/Desktop/* /home/$USER/Videos/* /home/$USER/Public/*
rm -rf ~/.local/share/Trash/*
# remove git config
git config --global --unset-all user.name
git config --global --unset-all user.email
@BrunoTorresF
BrunoTorresF / PC-setup.sh
Last active April 19, 2019 16:58
DevEnv Installation Script
#!/bin/sh
sudo apt update
# git
sudo apt install git -y
# cUrl
sudo apt install curl -y
# nvm node npm
sudo -k
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="$HOME/.nvm"