Skip to content

Instantly share code, notes, and snippets.

View letanure's full-sized avatar
🏠
Working from home

luiz tanure letanure

🏠
Working from home
View GitHub Profile
@letanure
letanure / gist:80d4b51585b5979f0080ae0114058e38
Created February 28, 2024 00:25
fetch twitter response and eval
fetch("https://twitter.com/i/api/graphql/q2SYrdJX7r5Lf0e6sHuM9g/TweetDetail?variables=%7B%22focalTweetId%22%3A%221762536011752485276%22%2C%22with_rux_injections%22%3Afalse%2C%22includePromotedContent%22%3Atrue%2C%22withCommunity%22%3Atrue%2C%22withQuickPromoteEligibilityTweetFields%22%3Atrue%2C%22withBirdwatchNotes%22%3Atrue%2C%22withVoice%22%3Atrue%2C%22withV2Timeline%22%3Atrue%7D&features=%7B%22responsive_web_graphql_exclude_directive_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Afalse%2C%22creator_subscriptions_tweet_preview_api_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22responsive_web_graphql_skip_user_profile_image_extensions_enabled%22%3Afalse%2C%22c9s_tweet_anatomy_moderator_badge_enabled%22%3Atrue%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22longform_notet
@letanure
letanure / signing-git-commits.md
Created November 23, 2023 14:23 — forked from phortuin/signing-git-commits.md
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@letanure
letanure / gist:dc588e335b583607e87ef74c7b0e92ac
Created November 21, 2023 13:09
One line lint install & run
echo '.eslintignore\n.eslintrc.json\n.stylelintrc' >> .gitignore; echo '!**/*.snap\n!coverage\n!node_modules\n!.jest\n!generators/templates\n!.lintstagedrc.js\n' > .eslintignore; echo '{\n "env": {\n "browser": true,\n // "jest": true,\n // "node": true\n "es2021": true\n },\n // "settings": {\n // "react": {\n // "version": "detect"\n // }\n // },\n "extends": [\n "next/core-web-vitals",\n "eslint:recommended",\n "plugin:@typescript-eslint/recommended",\n "plugin:react/recommended",\n "prettier",\n "plugin:prettier/recommended"\n ],\n "parser": "@typescript-eslint/parser",\n "parserOptions": {\n "ecmaVersion": "latest",\n "sourceType": "module"\n },\n "plugins": [\n "@typescript-eslint",\n "react"\n // "react-hooks"\n ],\n "rules": {\n "react-hooks/rules-of-hooks": "error",\n "react-hooks/exhaustive-deps": "warn",\n "react/prop-types": "off",\n "react/react-in-jsx-scope": "off",\n "@typescript-eslint/explicit-module-boundary-t
@letanure
letanure / emoTranslate.js
Created October 29, 2021 17:13
emo translator wip
function searchCharInArray(char, array) {
for (let i = 0; i < array.length; i++) {
if (array[i].indexOf(char) !== -1) {
return array[i].indexOf(char);
}
}
return false;
}
function replaceAll(str, find, replace) {
@letanure
letanure / copyFileStrapiAdmin.js
Last active October 26, 2021 18:35
NodeJs utility to copy files from Strapi admin to the current project and overwrite behaviors
// npm install inquirer-fuzzy-path inquirer ncp -D
// or
// yarn add inquirer-fuzzy-path inquirer ncp -D
const inquirer = require("inquirer");
const fs = require("fs");
const ncp = require("ncp").ncp;
inquirer.registerPrompt("fuzzypath", require("inquirer-fuzzy-path"));
@letanure
letanure / cidades-brasil-codigo-ibge.json
Last active September 14, 2021 20:58
codigo cidades estados do brasil extraido do site do IBGE
[
{
"codigoUf": 52,
"codigo": 5200050,
"nome": "Abadia de Goiás",
"slug": "abadia-de-goias",
"microrregiao": 52010,
"regiaoImediata": 520001
},
{
@letanure
letanure / insurance.json
Created May 14, 2021 17:17
german insurance companies
[
{
"id":319,
"name":"Allgemein-Kassenleistung als Privatversicherung",
"type":"public"
},
{
"id":280,
"name":"Selbstzahler",
"type":"self-pay"
@letanure
letanure / optimise-images-terminal.md
Created May 10, 2021 13:51 — forked from gielcobben/optimise-images-terminal.md
Optimise your pngs from the terminal in OSX

JPG:
$ brew install jpegoptim
$ find . -name "*.jpg" -exec jpegoptim -m80 -o -p --strip-all {} \;

- PNG:
$ brew install optipng
$ find . -name "*.png" -exec optipng -o7 {} \;

// Menu: Text / String transformations
// Description: spaces, accents, cases, variables names
// Author: Luiz Tanure
// Twitter: @tanure
let { getSelectedText, setSelectedText } = await kit("text")
// let userString = await arg("Type or paste the text to transform:")
String.prototype.upperCaseFirstLetter = function () {
// Menu: Text / String transformations
// Description: spaces, accents, cases, variables names
// Author: Luiz Tanure
// Twitter: @tanure
let { getSelectedText, setSelectedText } = await kit("text")
// let userString = await arg("Type or paste the text to transform:")
String.prototype.upperCaseFirstLetter = function () {