Skip to content

Instantly share code, notes, and snippets.

vsambor

  • Sophia Antipolis, France
View GitHub Profile
@vsambor
vsambor / JavaScriptGetNestedValues.js
Last active Jun 4, 2019
A JavaScript function which assures that a value of a child chain property is returned without runtime errors.
View JavaScriptGetNestedValues.js
const obj = {
c: {
a: 2,
b: {
c: [1, 2, 3, {a: 15, b: 10}, 15]
},
c: undefined,
d: null
},
d: ''
@vsambor
vsambor / .sass
Created Dec 25, 2017
SASS Margin and Padding Helper Generator
View .sass
# Margin and Padding Helper Generator
$space: (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 35, 40, 45, 50, 75, 100);
$pos: (top, bottom, left, right);
@each $s in $space {
.m#{$s} { margin: #{$s}px; }
.p#{$s} { margin: #{$s}px; }
@each $p in $pos {
.m#{str-slice($p, 0, 1)}-#{$s} { margin-#{$p}: #{$s}px; }
You can’t perform that action at this time.