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 / cloudSettings
Last active November 5, 2018 16:00
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-11-05T16:00:07.487Z","extensionVersion":"v3.2.0"}

[email protected] | +44 7475 543 865

Paulo Portella – Front End Developer

  • 1+ years of experience as a front end developer
  • Owns a small consulting company to channel freelance work

Skills

  • Programming Language – JavaScript, CSS, HTML, Python, GraphQL
  • Architectural Pattern – Model View Controller, Server Side Rendering
firstDuplicate = a => {
r = new Set()
for (e of a)
if (r.has(e))
return e
else
r.add(e)
return -1
}
firstNotRepeatingCharacter = s => {
r = {}
for (e of s)
r[e] = -~r[e]
for (e in r)
if (r[e] == 1)
return e
return '_'
}
rotateImage = a => a.map((row, rowIndex) => a.map(val => val[rowIndex]).reverse())
//Turn columns into rows
var transpose = grid =>
grid[0].map(
(_,c) => grid.map(
row => row[c]
)
)
//Turn sub-grids into rows
var expandSubGrids = grid => {
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];
containsDuplicates = a => a.length > new Set(a).size
sumOfTwo = (a, b, v) => (
b = new Set(b),
a.some(e => b.has(v - e))
)

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