This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hify from './create-element'; | |
| import React from 'react'; | |
| import { render } from 'react-dom'; | |
| const h = hify(React.createElement.bind(React)); | |
| class Test extends HTMLElement { | |
| static observedAttributes = ['attr'] | |
| attributeChangedCallback (name, oldValue, newValue) { | |
| this.innerHTML = `Hello, ${this.getAttribute('attr')}!`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { h, Component } from 'preact'; | |
| import Markup from 'preact-markup'; | |
| import register from './preact-custom-element'; | |
| // just a proxy component: WC -> Preact -> WC | |
| const A = () => <x-b foo="initial foo from <x-a>" />; | |
| // stateful component that can re-render | |
| class B extends Component { | |
| render(props, state) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var through = require('through2'); | |
| var sourcemaps = require('gulp-sourcemaps'); | |
| var postcss = require('gulp-postcss'); | |
| var filter = require('gulp-filter'); | |
| var concat = require('gulp-concat'); | |
| var modules = require('postcss-modules'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Inspired by XRegExp via 2ality | |
| * http://www.2ality.com/2012/12/template-strings-xregexp.html | |
| * http://xregexp.com/ | |
| */ | |
| import test from 'ava'; | |
| export function rx(flags) { | |
| const trailingComments = /\s+#.*$/gm; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Based on https://github.com/nodyn/jvm-npm | |
| "use strict"; | |
| (function() { | |
| var System = java.lang.System, | |
| File = java.io.File, | |
| FileInputStream = java.io.FileInputStream, | |
| StringBuilder = java.lang.StringBuilder, | |
| BufferedReader = java.io.BufferedReader, | |
| InputStreamReader = java.io.InputStreamReader; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function _exec_with | |
| set -l shell $argv[1] | |
| set -l file $argv[2] | |
| set -l code $argv[3] | |
| set -l source | |
| switch "$shell" | |
| case bash zsh ksh | |
| set source . | |
| case '*' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # git-cleanup-repo | |
| # | |
| # Author: Rob Miller <rob@bigfish.co.uk> | |
| # Adapted from the original by Yorick Sijsling | |
| git checkout master &> /dev/null | |
| # Make sure we're working with the most up-to-date version of master. | |
| git fetch |
NewerOlder