Skip to content

Instantly share code, notes, and snippets.

Avatar

luiz tanure letanure

View GitHub Profile
@letanure
letanure / emoTranslate.js
Created Oct 29, 2021
emo translator wip
View emoTranslate.js
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 Oct 26, 2021
NodeJs utility to copy files from Strapi admin to the current project and overwrite behaviors
View copyFileStrapiAdmin.js
// 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 Sep 14, 2021
codigo cidades estados do brasil extraido do site do IBGE
View cidades-brasil-codigo-ibge.json
[
{
"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
german insurance companies
View insurance.json
[
{
"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 — forked from gielcobben/optimise-images-terminal.md
Optimise your pngs from the terminal in OSX
View optimise-images-terminal.md

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

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

View text-transformations.js
// 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 () {
View text-transformations.js
// 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 () {
View text-transformations.js
// 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 () {
@letanure
letanure / lastpass-export.js
Created Jul 24, 2020
My company uses lastpass and dont allow export passwords and usernames. open the web interface and run on console
View lastpass-export.js
var edits = document.querySelectorAll('.itemButton.edit')
var count = 0
var interval = setInterval(async function(){
count++
edits[count].click()
setTimeout(() => {
var url = document.getElementById('siteDialogURL').value
var name = document.getElementById('siteDialogName').value
var username = document.getElementById('siteDialogUsername').value
var password = document.getElementById('siteDialogPassword').value
View ievms.sh
#!/usr/bin/env bash
# Caution is a virtue.
set -o nounset
set -o errtrace
set -o errexit
set -o pipefail
# ## Global Variables