here are two commands I made a while back and some of you may find handy to find and replace stuff on the terminal:
Find JS files with stuff
:
findjs stuff
Find .view files with border
:
findview border
import React from 'react' | |
const ThemeContext = React.createContext({ | |
color: 'orange', | |
toggleColor() {}, | |
}) | |
class Theme extends React.Component { | |
state = { | |
color: 'orange', |
import { Animation, Globals } from 'react-spring/dist/web' | |
const withDefault = (value, defaultValue) => (value === undefined || value === null ? defaultValue : value) | |
const stiffnessFromOrigamiValue = oValue => (oValue - 30) * 3.62 + 194 | |
const dampingFromOrigamiValue = oValue => (oValue - 8) * 3 + 25 | |
const fromOrigamiTensionAndFriction = (tension, friction) => ({ | |
stiffness: stiffnessFromOrigamiValue(tension), | |
damping: dampingFromOrigamiValue(friction) | |
}) |
import React from 'react' | |
const UserContext = React.createContext({}) | |
export const Consumer = Context.Consumer | |
export class Provider extends React.Component { | |
constructor(props) { | |
super(props) |
function a({ en, es, pl, fr, ch, ja }) { | |
return en | |
? 'hi' | |
: es | |
? 'hola' | |
: pl ? 'czezch' : fr ? 'bon jour' : ch ? 'ni hao' : ja ? 'wtf' : ''; | |
} | |
const l = { | |
en: 'hi', |
here are two commands I made a while back and some of you may find handy to find and replace stuff on the terminal:
Find JS files with stuff
:
findjs stuff
Find .view files with border
:
findview border
const { execSync } = require('child_process') | |
function getStatsFor(person) { | |
const data = execSync( | |
`git log --name-only --author=${person} --pretty=format: | sort | uniq | sort -nr`, | |
{ | |
encoding: 'utf-8', | |
} | |
) |
const TIMEOUT = 100 | |
const click = () => (dispatch, getState) => { | |
setTimeout(dispatch({ | |
type: 'CLICK' | |
}, TIMEOUT) | |
} | |
const Button = props => { |
const cleanPath = s => /\?/.test(s) ? s.match(/(.*?)\?/)[1] : s | |
const routes = [ | |
'https://my-review-cert.hrw.com/content/selenas-blog--thing?q=1', | |
'https://my-review-cert.hrw.com/toc', | |
'https://very-specific.com/toc/super-toc/thing', | |
'https://my-review-cert.hrw.com/content/selenas-blog--thing/https://my-review-cert.hrw.com/toc', | |
'https://panels.com/thing/that' | |
] |
import React, { Component } from 'react' | |
const click = () => ({ | |
type: 'CLICK' | |
}) | |
const reducer = (state={clicked: false}, action) => { | |
switch (action.type) { | |
case 'CLICK': | |
return { |
It's a collaborative tool to allow teams of developers and designers to move extremely fast from concept to real applications that work on the web and on Android and iOS.
It takes a JSON and outputs React code.
Designers and developers work together on the JSON code.