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) { | |
const j = api.jscodeshift; | |
const root = j(file.source); | |
try { | |
root.find(j.JSXSpreadAttribute) | |
.forEach(path => { | |
const spreadProps = path.node.argument; | |
if (!spreadProps.properties) return; |
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
{ | |
heating: [ | |
{ | |
cost: 4.11, | |
date: 'Di.' | |
}, | |
{ | |
cost: 4.11, | |
date: 'Mi.' | |
}, |
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
04ea31fa598b02dcad3fff9b55f7bbae770728a192332fddb5e22e77bfac37cf73c767a571926b42588715d45c13dde1e27b79c5e0dca9c802d1709f718bcdd430;rabc |
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 { | |
compose, | |
findIndex, | |
pullAt, | |
curry, | |
} from 'lodash/fp'; | |
const MY_LIST = [/* items here */]; | |
const removeFromList = curry((itemToRemove, list) => compose( |
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 { | |
compose, | |
findIndex, | |
cond, | |
} from 'lodash/fp'; | |
const MY_LIST = [/* items here */]; | |
const findMyItemIndex = findIndex(item => item === 'MY_ITEM'); | |
const changeItemToSomething = () => // returns NEW object (immutable) |
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 { | |
compose, | |
findIndex, | |
cond, | |
} from 'lodash/fp'; | |
const MY_LIST = [/* items here */]; | |
const findMyItemIndex = findIndex(item => item === 'MY_ITEM'); | |
const changeItemToSomething = () => // returns NEW object (immutable) |
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
class A { | |
constructor(){ | |
this.method3 = this.method3.bind(this); | |
} | |
method1() { | |
} | |
method2 = () => { | |
} |
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
------------------ | |
System Information | |
------------------ | |
Serial Number: 9S7179111077ZF5000145 | |
Product Name: GE72 2QF | |
OS: Microsoft Windows 10 Home 64-bit | |
Windows Product Key: 8HVX7 | |
HDI Build: non-OEM | |
BIOS Version: E1791IMS.113 | |
BIOS Release Date: 2016/04/19 |
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
> require.extensions['.svg'] = () => 1; | |
[Function] | |
> var bla = require('../icons/icon-close.svg') | |
undefined | |
> bla | |
{} |
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
$python parallel.py | |
[13:48:59:130701] Doing GET request to http://google.com | |
[13:48:59:134958] Doing GET request to http://facebook.com | |
[13:48:59:135498] Doing GET request to http://twitter.com | |
[13:48:59:136174] Doing GET request to http://slack.com | |
****** STATUSES: [{'status': 200, 'url': 'http://google.com'}, {'status': 200, 'url': 'http://twitter.com'}, {'status': 200, 'url': 'http://slack.com'}, {'status': 200, 'url': 'http://facebook.com'}] | |
$python sequential.py | |
[13:49:04:078752] Doing GET request to http://google.com | |
[13:49:04:232725] Doing GET request to http://facebook.com |
NewerOlder