I hereby claim:
- I am fgnass on github.
- I am fgnass (https://keybase.io/fgnass) on keybase.
- I have a public key whose fingerprint is 1D87 FE70 F6DF 29D4 A059 C2F4 536D C5D7 071B 22BA
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var debug = require('debug') | |
debug.enable('*') | |
var log = debug('test') | |
log('Hello world', window) |
// install node-jsx in a separate module | |
require('./install-jsx') | |
// require a jsx file | |
require('./test') | |
// keep node running ... | |
setInterval(function() {}, 100000) |
Ideas for https://github.com/fgnass/jssx
Currently JSSX follows a simple rule to decide whether a prop is class name or a regular HTML attribute:
For any given prop, if a JSS class with the same name exits, it is interpreted as className, otherwise as attribute.
import styled, { css } from 'styled-components'; | |
const Button = styled.button` | |
font-size: 1em; | |
margin: 1em; | |
border: 2px solid palevioletred; | |
border-radius: 3px; | |
import styled, { css } from 'styled-components'; | |
const Button = styled.button` | |
font-size: 1em; | |
margin: 1em; | |
border: 2px solid palevioletred; | |
border-radius: 3px; | |
color: palevioletred; | |
${props => props.primary && css` |
import webdriver from 'friendly-webdriver'; | |
import unexpected from 'unexpected'; | |
import unexpectedWebdriver from 'unexpected-webdriver'; | |
import retractor from 'retractor'; | |
const expect = unexpected.clone(); | |
expect.use(unexpectedWebdriver()); | |
/* @jsx retractor */ |
// Paste this into your borwser's console on the Alexa Skill testing page: | |
document.addEventListener('click', ev => { | |
if (ev.target.matches('.askt-dialog__message--request')) { | |
const el = document.querySelector('.askt-utterance__input'); | |
el.focus(); | |
document.execCommand('insertText', false, ev.target.innerText); | |
el.dispatchEvent( | |
new KeyboardEvent('keypress', { bubbles: true, keyCode: 13 }) | |
); |
(function() { | |
let i = 0; | |
const el = document.querySelector('.askt-utterance__input'); | |
el.addEventListener('keyup', function(ev) { | |
const req = document.querySelectorAll('.askt-dialog__message--request'); | |
if (ev.key == 'ArrowUp') i = i >= req.length - 1 ? 0 : i + 1; | |
else if (ev.key == 'ArrowDown') i = i > 0 ? i - 1 : req.length - 1; | |
else return; | |
el.value = ''; | |
document.execCommand('insertText', false, req[i].innerText); |
#!/bin/bash | |
set -e | |
# Rename files to make them URL friendly | |
# https://formulae.brew.sh/formula/slugify | |
slugify * | |
# Trim silence at the beginning |