This file contains 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
export default function transformer(file, api, options) { | |
const j = api.jscodeshift; | |
const root = j(file.source); | |
let hasModifications = false; | |
const reactDomFactoriesModuleName = 'react-dom-factories'; | |
const findReact = (j, root) => { | |
// Check for import | |
// i.e. `import React from 'react'` |
This file contains 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
const puppeteer = require('puppeteer'); | |
(async function() { | |
const browser = await puppeteer.launch({ devtools: true }); | |
const page = await browser.newPage(); | |
// Login | |
await page.goto('http://localhost:8080'); | |
await page.type('#login', 'username'); |
This file contains 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
"use strict"; | |
Object.defineProperty(exports, "__esModule", { value: true }); | |
var currency_js_1 = require("currency.js"); | |
currency_js_1.default(1).add(1.1); |
This file contains 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'; | |
class AsyncComponent extends Component { | |
constructor() { | |
super(); | |
this.state = { loading: true }; | |
this.getAsyncState = this.getAsyncState.bind(this); | |
this.update = this.update.bind(this); | |
} |
This file contains 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
let [ up, down, left, right, esc, space ] = [38, 40, 37, 39, 27, 32]; |
This file contains 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
const webpack = require('webpack') | |
, path = require('path'); | |
module.exports = { | |
entry: { | |
'global': './src/app.jsx', | |
}, | |
resolve: { | |
extensions: ['.js', '.jsx'] | |
}, |
This file contains 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'; | |
class AsyncComponent extends Component { | |
constructor() { | |
super(); | |
this.state = { loading: true }; | |
this.getAsyncState = this.getAsyncState.bind(this); | |
this.update = this.update.bind(this); | |
} |
This file contains 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
git config alias.undo-commit 'reset --soft HEAD^' | |
git config alias.ls "log --pretty=format:'%C(yellow)%h%Creset %s %C(cyan)(%cr)%Creset %Cgreen<%cn>%Creset'" |
This file contains 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/sh | |
# Stop console.log statements from going into github | |
for file in `git diff-index --name-only HEAD --cached | egrep \.js$`; do | |
OUT=$(awk '/console\.(log|debug|warn|info)/ { print "\\t"NR": "; print $0; print "\\n" }' $file) | |
if [ -n "$OUT" ]; then | |
echo -e "\n".$file |