Skip to content

Instantly share code, notes, and snippets.

View MelodicCrypter's full-sized avatar

Hugh Caluscusin MelodicCrypter

View GitHub Profile
// Developer: Hugh Caluscusin
// Git: @MelodicCrypter
// Mutable states
let colsData = [1,2,3,4]; // example -> A,B,C,D
let colResult = 5; // example -> E
const ERR_BG_COLOR="#EEB8AE",SEMI_CORRECT_BG_COLOR="#CFE2F3",CORRECT_BG_COLOR="#86FFBA";function onOpen(e){SpreadsheetApp.getUi().createAddonMenu().addItem("Run","runAddressLookup").addSeparator().addItem("Revert","revertResultsColumn").addToUi()}function onInstall(e){onOpen(e)}function setting(e,t){e&&(colsData=e),t&&(colResult=t)}function runAddressLookup(){Logger.log("\uD83D\uDD25 Script is running.");let e=SpreadsheetApp.getActiveSheet(),t=e.getDataRange().getValues(),o=Maps.newGeocoder();o.setLanguage("it");let n=colResult,a=colsData.map(e=>Number(e)-1);if(0===t.length)throw Error("The file is empty!");if(t.length>0&&t.length<2)throw Error("Row 1 is expected for Headers only! Put real data starting on row 2.");t&&t.forEach((t,o)=>{if(0===o||(console.log("address",""===t[a[0]]),console.log("city",""===t[a[1]]),console.log("postal",""===t[a[2]]),consol
@MelodicCrypter
MelodicCrypter / .eslintignore
Last active February 5, 2022 08:27
Starter settings for React (Web or Native) with TypeScript, ESLint, Prettier, and Apollo. Also, GraphQL, Bulma and Webfont Loader are included.
# dependencies
/node_modules
# testing
/coverage
# production
build/*
build
@MelodicCrypter
MelodicCrypter / Code-Snippets.txt
Last active February 5, 2022 07:26
Command Line, Shortcuts, Hot key, snippets - random.
// CLI: Deleting all dot files inside a directory
rm -rf ..?* .[!.]* *
// Updated 2022, this worked for me
rm -rf .*
@MelodicCrypter
MelodicCrypter / React-IndexExport.jsx
Last active April 15, 2021 15:50
Webstorm Live Templates
// Code: edf
// Desc: For export components using index
export { default } from '.$END$';
@MelodicCrypter
MelodicCrypter / HTTP_STATUSES.txt
Created March 31, 2021 01:46
HTTPS status codes and meaning
from: https://httpstatuses.com/
1×× Informational
100 Continue
101 Switching Protocols
102 Processing
2×× Success
200 OK
201 Created
@MelodicCrypter
MelodicCrypter / bgWithOverlay.css
Last active March 31, 2021 01:30
Image with overlay text CSS
#theElement {
background-image:
linear-gradient(to bottom, rgba(245, 246, 252, 0.52), rgba(117, 19, 93, 0.73)),
url('images/background.jpg');
width: 80%;
height: 400px;
background-size: cover;
color: white;
padding: 20px;
}
@MelodicCrypter
MelodicCrypter / .eslintignore
Last active September 14, 2020 03:59
Common Dev Dependencies and Their Configurations (ESLint and Prettier). Check all four files inside this gist. TL-DR: yarn add -D babel-eslint babel-plugin-module-resolver eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-import eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks gatsby-plugin-eslint eslint-loader…
node_modules
.next
@MelodicCrypter
MelodicCrypter / .eslintignore
Last active March 30, 2020 04:16
Common development setup for React => Babel, ESLint and Prettier (with or without Flow).
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
@MelodicCrypter
MelodicCrypter / .babelrc
Last active March 10, 2020 08:13
Common development setup for NodeJS projects: Babel, ESLint, Prettier, etc.
{
"presets": [
"@babel/preset-env"
]
}
@MelodicCrypter
MelodicCrypter / existing-repo.txt
Created February 14, 2020 14:47
Adding local repo to existing remote repository.
git remote add origin remote repository URL
git remote -v
git push -u origin master