Skip to content

Instantly share code, notes, and snippets.

View pauloportella's full-sized avatar
👋
Hi there!

Paulo Portella pauloportella

👋
Hi there!
  • Telus Health
  • UK
View GitHub Profile
@pauloportella
pauloportella / conventional-comments.md
Last active April 23, 2024 09:36
How to setup conventional comments on Github

Conventional comments

Source

You can add all conventional comments Labels to Github as a saved replies by following the following steps:

  1. Go to https://github.com/settings/replies
  2. Open Developer Tools
  3. Copy/Paste above code in JavaScript console
  4. Press enter
{
"window.zoomLevel": 2,
"editor.formatOnType": true,
"explorer.confirmDragAndDrop": false,
"javascript.updateImportsOnFileMove.enabled": "never",
"atomKeymap.promptV3Features": true,
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"workbench.startupEditor": "newUntitledFile",
"window.nativeFullScreen": false,
@pauloportella
pauloportella / radio-group.html
Created September 18, 2018 22:34 — forked from robdodson/radio-group.html
A Custom Element radio group which demonstrates roving tabindex
<!--
Copyright 2016 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and

./node_modules/.bin/prettier --single-quote --write "src/**/*.{js,jsx,json,css}"

sumOfTwo = (a, b, v) => (
b = new Set(b),
a.some(e => b.has(v - e))
)
containsDuplicates = a => a.length > new Set(a).size
function isCryptSolution(crypt, solution) {
//Map every character, as given in the solution
var map = {};
for(var m of solution)
map[m[0]] = m[1];
//Ensure no leading zeroes or poorly translated values
for(var i in crypt) {
var line = crypt[i];
//Turn columns into rows
var transpose = grid =>
grid[0].map(
(_,c) => grid.map(
row => row[c]
)
)
//Turn sub-grids into rows
var expandSubGrids = grid => {
rotateImage = a => a.map((row, rowIndex) => a.map(val => val[rowIndex]).reverse())
firstNotRepeatingCharacter = s => {
r = {}
for (e of s)
r[e] = -~r[e]
for (e in r)
if (r[e] == 1)
return e
return '_'
}