Skip to content

Instantly share code, notes, and snippets.

View lucianobarauna's full-sized avatar
🐢

Luciano Baraúna lucianobarauna

🐢
View GitHub Profile
@lucianobarauna
lucianobarauna / px-to-rem.scss
Created December 2, 2020 21:12 — forked from premregmi/px-to-rem.scss
PX TO REM FUNCTION in SASS - Convert px value to rem easily in SASS
// SASS FUNCTION TO CONVERT PX INTO REM
// Defining base font size
// The default font size for html is 16px
$base-size: 16;
//Function to convert px value into rem
//You can replace rem with any other value you want (rem is most preferred value for web)
@function size($target, $context: $base-size) {
@return ($target / $context) * 1em;
}
@lucianobarauna
lucianobarauna / reduce-array-multidimensional.js
Created June 7, 2018 19:50 — forked from shx-dev/reduce-array-multidimensional.js
Artigos | Array.reduce  - O canivete suíço da programação funcional | Array multidimensional
const users = [
{
name: 'User #1',
bookmarks: [
{ title: 'Movie #1', id: 1 },
{ title: 'Movie #6', id: 6 },
{ title: 'Movie #3', id: 3 },
]
},
{
@lucianobarauna
lucianobarauna / PinchZoomPan.js
Created May 11, 2018 22:26 — forked from iammerrick/PinchZoomPan.js
React Pinch + Zoom + Pan
import React from 'react';
const MIN_SCALE = 1;
const MAX_SCALE = 4;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;