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
| <?xml version="1.0" encoding="utf-8"?> | |
| <rss version="2.0"> | |
| <channel> | |
| <title>test</title> | |
| <link>https://gist.github.com/FreddieRidell/d17719b4dc61855b2ca0b358c6f29433/raw/0e8b0eb980016c6460ea341eb06cb7567918b3c2/rss.xml</link> | |
| <item> | |
| <title>After Laughter</title> | |
| <description>test</description> | |
| <guid>6DE5B3D36A9F0FFD90DE386456B080EB3F20871B</guid> |
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
| version: '2' | |
| services: | |
| nginx-proxy: | |
| restart: always | |
| image: jwilder/nginx-proxy | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| volumes: |
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
| //// REACT VERSION | |
| const JsonEditor = ({ valueObject, onChange }) => { | |
| return <input | |
| value = {JSON.stringify(valueObject)} | |
| onChange = { e => onChange(JSON.parse(e.target.value))} | |
| /> | |
| }; | |
| const Parent = () => { | |
| const [objState, setObjState] = React.useState({}); |
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
| // current: | |
| () => { | |
| // good, vast improvment over previous validation system. | |
| // However, this now validates by passing a mutable refference down to children, | |
| // then reading mutated properties on that reference: not very react-y | |
| const validator = useMemo(() => new Validator(validations), []); | |
| const [state, onChange] = useState(""); | |
| const errors = validator.errors; |
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
| dwadwadwa |
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
| /// reselect version: | |
| const selectFoo = storeState => storeState.foo; | |
| const selectProp = (_, props) => props.id; | |
| export const selectBar = createSelector( | |
| selectFoo, | |
| selectProp, | |
| (foo, propId) => | |
| Object.keys(foo).map(id => ({ | |
| id, | |
| ...foo[id], |
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
| "foo Bar ' baz".replace( /[A-Z]/g, x => x.toLowerCase()).replace( /[^a-z0-9-\s]/g, "").replace( /\s+/g, "-" ) |
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
| //------------------------------ | |
| // Before | |
| //------------------------------ | |
| class ShouldntBeInAClass { | |
| public getBalance = (locals: ILocals): Promise<IBalanceResponse> => { //type definition located in another file | |
| const {url, options, transform} = GET_BALANCE_CONFIG; //defined at the top of this file, used nowhere else | |
| return this.fetch<IResponse>(url, {dynamics: locals, ...options}) | |
| .then(authoriseResponse) //called in 90% of methods |
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: formatDate} = require('date-fns/fp'); | |
| const createGlot = dictionary => { | |
| const parseStrings = (lang, value, strs, exprs) => { | |
| const key = strs.map((str, i) => str + (exprs[i] || '')).join(''); | |
| const found = dictionary[lang][key]; | |
| if (found === undefined) { | |
| return `~~NO GLOT FOUND FOR ${key}!!!~~`; | |
| } |
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 R = require("ramda"); | |
| let stamps = []; | |
| let i = 0; | |
| while (++i) { | |
| stamps = R.pipe( | |
| R.append(i), | |
| R.groupBy(x => Math.floor(3 * Math.log(i - x + 1, 2))), | |
| R.values, | |
| R.map(R.head), |
NewerOlder