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
const g = (() => { | |
const fn = f; | |
const p0 = 1; | |
return (a0, a1) => fn(a0, p0, a1); | |
})(); |
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 gql from 'graphql-tag'; | |
import { withApollo, Query, Mutation } from 'react-apollo'; | |
<Fragment> | |
<Query>{... stuff here}</Query> | |
<Mutation mutation={gql`${deleteFile}`} variables={{ name, path }} > // [eslint] Unexpected use of 'name'. [no-restricted-globals] | |
{postMutation => <button onClick={postMutation}>Submit</button>} | |
</Mutation> | |
</Fragment> |
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
const format = fileList => fileList.map(({ time }) => ({ | |
savedAt: moment(time).format(), | |
})); |
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
const getNameWithInitial = function () { | |
let initial = this._gender === 'male' ? | |
'Mr. ' : | |
'Mrs. '; | |
return initial + this._name; | |
} | |
export class Person { | |
constructor(name, gender) { |
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 must return | |
function foo() { | |
if (someCondition) { | |
return this.props.history.push('/somewhere'); | |
} | |
} | |
// this was ok | |
function foo() { |
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
if (someCondition) { | |
doStuff(); | |
return; | |
} |
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
ALTER TABLE <tablename> | |
ADD columnname datatype; |
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
<script id='script-batch' type='text/javascript'> | |
(function(d){ | |
var js = d.createElement('script'); js.async = true; js.defer = true; | |
js.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'; | |
d.getElementsByTagName('head')[0].appendChild(js); | |
})(document); | |
</script> |
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 foo = { a: 2 }; | |
var b = foo; | |
//typing b into the console returns { a: 2 } | |
foo = { a: 10 }; | |
//typing b into the console still returns { a: 2 } | |
var foo = { a: 2 }; | |
var b = foo; | |
//typing b into the console returns { a: 2 } | |
foo.bar = 'hi'; |
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
let pickList; | |
setTimeout(async () => { | |
const foo = await apiCallWrapper(store, getParcelPickListItems, parcel.id); | |
pickList = foo[0]; | |
}, 5000); |