Skip to content

Instantly share code, notes, and snippets.

@willmendesneto
willmendesneto / extensions.json
Last active September 17, 2020 01:57
VSCode configuration when using TSFMT in your service
// List of recommended extensions
// Please add it inside your `.vscode` folder on the root of your project
// E.G. `.vscode/extensions.json`
{
"recommendations": [
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"editorconfig.editorconfig",
"eternalphane.tsfmt-vscode",
"ms-vscode.vscode-typescript-tslint-plugin"
@willmendesneto
willmendesneto / is-light.js
Last active May 17, 2020 15:02
Check if color is lighter or darker. Remove the comments and you can use the power of types (optional)
// This file is Typescript friendly
// Which means you can replace the function signatures and get
// the power of types in your WebApp 🔋
// const hexToRgb = (colorinHex: string): [number, number, number] | [] => {
const hexToRgb = (colorinHex) => {
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
const expandShorthandHexToFullForm = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
const hex = colorinHex.replace(expandShorthandHexToFullForm, (m, r, g, b) => r + r + g + g + b + b);
#!/bin/bash
#
# Checks and validations to be done before install command
#
# How to use
# $ chmod +x ./pre-install.sh
# $ ./pre-install.sh (-r|--registry) (-n|--npm-namespace)
#
# $ ./pre-install.sh --registry=https://registry.yarnpkg.com
# $ ./pre-install.sh --registry=https://registry.yarnpkg.com --npm-namespace=<my-namespace>
@willmendesneto
willmendesneto / a11y-dev-mode.css
Last active July 2, 2024 06:44
Using CSS for highlight errors in HTML - A11Y Linting HTML with CSS
/* Highliting accessibility errors in HTML */
/* highlight HTML element with invalid value for lang attribute */
html:not([lang]),
html[lang=""] {
border: 2px dotted red !important;
}
/* highlight images missing alt text */
img:not([alt]) {
@willmendesneto
willmendesneto / fetch-some-data.js
Created September 4, 2019 10:32
Example of User Timing API usage
const fetchSomeData = async () => {
const measureName = 'fetchSomeData';
const startMark = `[START]: ${measureName}`;
const endMark = `[END]: ${measureName}`;
try {
const url = 'your-url';
// starting the User Timing API marker for this request
performance.mark(startMark);
@willmendesneto
willmendesneto / get-ak-package-versions-by-tag.sh
Created June 24, 2019 06:34
Get all atlaskit package versions to be bumped by package and version
#!/bin/bash
#
# Get all atlaskit package versions to be bumped by package and version
#
# How to use
#
# $ cd <your-atlaskit-project>
# $ get-ak-package-versions-by-tag (-p|--pkg-version)
#
# EX:
@willmendesneto
willmendesneto / list-of-free-courses.txt
Created May 25, 2019 04:50
List of free courses for beginners
# List of free courses for beginners
## Frontend:
- Intro to HTML and CSS: https://www.udacity.com/course/intro-to-html-and-css--ud001
- Version Control with Git: https://www.udacity.com/course/version-control-with-git--ud123
- Intro to JavaScript: https://www.udacity.com/course/intro-to-javascript--ud803
- JavaScript and the DOM: https://www.udacity.com/course/javascript-and-the-dom--ud117
- Object-Oriented JavaScript: https://www.udacity.com/course/object-oriented-javascript--ud711
- Asynchronous JavaScript Requests: https://www.udacity.com/course/asynchronous-javascript-requests--ud109
@willmendesneto
willmendesneto / run-integration-tests-in-parallel.sh
Created February 21, 2019 09:35
Running browserstack integration tests in parallel
# this script should be called from package.json
# If required, add the `node_modules/.bin` content into your PATH variable
#
# Usage:
# chmod +x ./run-integration-tests-in-parallel.sh
# ./run-integration-tests-in-parallel.sh
# get files in folders
files=$(find packages/**/**/__tests__/integration -type f -name "*.js" -exec basename \{\} .js \;)
cmd="concurrently "
@willmendesneto
willmendesneto / README.txt
Created January 2, 2019 05:59
Retropie setup
RETROPIE SETUP
How To Install And Set Up RetroPie
https://www.youtube.com/watch?v=2QcC2GmV9Ew
After that, how to enable Browser Based RetroPie Manager
https://www.youtube.com/watch?v=DgQDg6SzBDg
And how to transfer files to RetroPie using a Mac
https://www.youtube.com/watch?v=WqPJQZfT2FA
@willmendesneto
willmendesneto / ng-publish.sh
Created August 15, 2018 13:17
ng-publish: Shell script with one of old examples to publish Angular libraries
# Usage:
# PKG_VERSION=<patch|minor|major> ./publish.sh
npm run test && \
npm run build && \
npm run bundlesize && \
node ./build.js && \
npm publish dist && \
npm version $PKG_VERSION -m "v%s"