Skip to content

Instantly share code, notes, and snippets.

View guilhermecomum's full-sized avatar

Guilherme Guerra guilhermecomum

View GitHub Profile
@brunolemos
brunolemos / linkedin-unfollow-everyone.js
Last active December 23, 2024 12:51
Unfollow everyone on Linkedin
(() => {
let count = 0;
function getAllButtons() {
return document.querySelectorAll('button.is-following') || [];
}
async function unfollowAll() {
const buttons = getAllButtons();
@bashenk
bashenk / get_android_service_call_numbers.sh
Last active January 25, 2023 19:49 — forked from ktnr74/get_android_service_call_numbers.sh
POSIX compliant and portable fork. Now has been updated with more optional parameters, more optimizations, and better error handling. If -t or -v are specified, an android device is not required.
#!/usr/bin/env sh
set -u
# https://stackoverflow.com/questions/2683279/how-to-detect-if-a-script-is-being-sourced#28776166
sourced=0
if [ -n "${ZSH_EVAL_CONTEXT-}" ]; then
case $ZSH_EVAL_CONTEXT in *:file) sourced=1;; esac;
elif [ -n "${KSH_VERSION-}" ]; then
if [ "$(cd "$(dirname -- "$0")" && pwd -P)/$(basename -- "$0")" != "$(cd "$(dirname -- "${.sh.file}")" && pwd -P)/$(basename -- "${.sh.file}")" ]; then
sourced=1
@diegopacheco
diegopacheco / vscode-plugins-export.md
Created February 28, 2019 02:26
Generate plugin install for VSCode
code --list-extensions | xargs -L 1 echo code --install-extension
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active July 4, 2025 21:38
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@clarete
clarete / cacheddownload.py
Last active September 28, 2018 18:25
First lines of every single scraper/downloader I write in Python
def download(url):
"Use request to retrieve URL's content. It sleeps 1s before starting."
time.sleep(3) # Can't bring the scraped site down :)
return requests.get(url).text
def saverequest(path, req):
"Write `req' into file pointed by `path'. Assumes `req' is in UTF-8."
io.open(path, 'w', encoding='utf-8').write(req)
return req
@CodyReichert
CodyReichert / react-es6-flow-emacs-configuration.md
Last active June 21, 2025 13:28
Configuring Emacs for react, es6, and flow

Configuring Emacs for react, es6, and flow

For a while, JSX and new es6 syntax had flaky support in emacs, but there's been huge work on a lot of packages. Using emacs for JavaScript with React, ES6, and Flow (or Typescript, etc) is really easy and powerful in Emacs these days.

This is how you can work on modern web development projects with full support for tooling like JSX, Flow types, live eslint errors, automatic prettier.js formatting, and more.

Set up web-mode

web-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.

@spyesx
spyesx / rsync_backup.sh
Last active April 18, 2025 09:50
Rsync backup excluding node_modules
# Backup files
#https://explainshell.com/explain?cmd=rsync+-azuv+--delete+--progress+--exclude+%27node_modules%27
rsync -auvhp --delete --exclude=node_modules [source] [destination]
# Remove all node_modules folders
# https://explainshell.com/explain?cmd=find+.+-name+%22node_modules%22+-type+d+-prune+-exec+rm+-rf+%27%7B%7D%27+%2B
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
@001101
001101 / accounting.sql
Created February 18, 2017 09:08 — forked from NYKevin/accounting.sql
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...
/**
* Usage:
* Go to https://objectedge.slack.com/files/{username}
* and run this code in the browser console
*
* To remove only files older than a given date, configure "older_than" with appropriate value
* Ex: "2016-12-14", "2015-12-31 17:35:14"
*
* To delete only images, configure types as "image"
* To delete all kind of files, configure types as "all"