Skip to content

Instantly share code, notes, and snippets.

View johnsylvain's full-sized avatar
🏗️
Building the internet

John Sylvain johnsylvain

🏗️
Building the internet
View GitHub Profile
@johnsylvain
johnsylvain / _bem.scss
Created January 6, 2018 01:59
BEM SCSS Mixin
/// Block Element
/// @access public
/// @param {String} $element - Element's name
@mixin element($element) {
&__#{$element} {
@content;
}
}
/// Block Modifier
@johnsylvain
johnsylvain / assign.js
Created January 13, 2018 14:10
Shallow `Object.assign` fill-in
const assign = (obj, ...props) => props.reduce((acc, prop) => {
for (let i in prop) acc[i] = prop[i]
return acc
}, obj)
// Usage
const state = {
todos: [
export function h (nodeName, attributes, ...children) {
children = [].concat.apply([], children)
attributes = attributes || {}
return typeof nodeName === 'function'
? nodeName(attributes, children)
: { nodeName, attributes, children }
}
export function render (parent, newNode, oldNode) {
@johnsylvain
johnsylvain / cookie-deserializer.js
Created June 22, 2018 21:51
A simple function to parse a browser cookie string

Keybase proof

I hereby claim:

  • I am johnsylvain on github.
  • I am jsyl (https://keybase.io/jsyl) on keybase.
  • I have a public key ASB0qmcsag6oUuyCKRejaHz_Ct1GFBYVub15VSSyFqc-mwo

To claim this, I am signing this object:

hi! 👋

i'm john. i enjoy writing software, making music, and creating products.

here are some projects i've worked on: