Skip to content

Instantly share code, notes, and snippets.

View danilowoz's full-sized avatar

Danilo Woznica danilowoz

View GitHub Profile
import { configure } from '@storybook/react'
import './style.css'
const req = require.context('../src/', true, /stories\.js$/)
function loadStories() {
req.keys().forEach(req)
}
configure(loadStories, module)
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: JavaScript (Babel)
file_extensions: [js, jsx, babel, es6]
first_line_match: ^#!\s*/.*\b(node|js)$\n?
scope: source.js
variables:
ident: '[_$a-zA-Z][$\w]*'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building a router</title>
<script>
var Router = {
routes: [],
mode: null,
root: '/',
@danilowoz
danilowoz / createNode.js
Created February 24, 2017 12:33
Convert String to Dom element
function createNode( html ) {
return new DOMParser().parseFromString( html, "text/html" ).body.firstChild
}
var foo = createNode("<p>Texto<span>Olá</span></p>");