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 files = Directory.EnumerateFiles(".").OrderBy(x => x).ToArray(); | |
| for (int i = 0; i < files.Length / 2; i++) | |
| { | |
| var paper = i / 2 + 1; | |
| var side = i % 2 == 0 ? 1 : 2; | |
| var page1 = i; | |
| var page2 = files.Length - i - 1; | |
| File.Move(files[page1], $"{paper}-{side}-{(side == 1 ? 'a' : 'b')}-{page1 + 1}.jpg"); |
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
| // type getUnitForm = ([string, string, string]) => (number) => string | |
| export const getUnitForm = ([nominative, genitive, plural]) => (num) => { | |
| num = Math.abs(num) % 100 | |
| if (num >= 11 && num <= 19) return plural | |
| switch (num % 10) { | |
| case (1): return nominative | |
| case (2): | |
| case (3): |
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'?> | |
| <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | |
| <fontconfig> | |
| <match target="font"> | |
| <edit mode="assign" name="antialias"> | |
| <bool>true</bool> | |
| </edit> | |
| <edit mode="assign" name="hinting"> | |
| <bool>true</bool> | |
| </edit> |
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 R from 'ramda' | |
| const recordsLens = R.lensPath(['foo', 'records']) | |
| const keysLens = R.lensPath(['bar', 'keys']) | |
| const reducer = (state, {type, payload}) => { | |
| switch (type) { | |
| case 'SET_RECORDS': return R.set(recordsLens, payload, state) | |
| case 'SET_RECORD': { | |
| const exactRecordLens = R.lensPath([payload.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
| fib :: Integer -> Integer | |
| fib n | |
| | n == 0 = 0 | |
| | abs n == 1 = 1 | |
| | n > 0 = fib (n - 2) + fib (n - 1) | |
| | otherwise = fib (n + 2) - fib (n + 1) | |
| fib2 :: Integer -> Integer | |
| fib2 n = fib2' 0 1 2 n |
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
| class Form extends React.Component { | |
| state = { value: '' } | |
| onChange = e => this.setState({ value: e.currentTarget.value }) | |
| onSubmit = () => console.log('The value is ', this.state.value) | |
| render() { | |
| return ( | |
| <form onSubmit={this.onSubmit}> |
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
| public class UploadItem | |
| { | |
| [Required, Range(1, int.MaxValue)] | |
| public int DataSourceId { get; set; } | |
| public string Description { get; set; } | |
| } |
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 trickyPropType = getPropTypeFromProps => | |
| (props, propName, componentName) => { | |
| const error = getPropTypeFromProps(props)(props, propName, componentName) | |
| if (error) return error // WIP | |
| } | |
| const Summary = ({ hasErrors, errors }) => | |
| <div> | |
| {hasErrors && | |
| errors.map(err => <span key={err}>{err}</span>)} |
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 withErrors = shape({ hasErrors: oneOf([true]).isRequired, errors: arrayOf(string).isRequired }) | |
| const withoutErrors = shape({ hasErrors: oneOf([false]).isRequired, errors: arrayOf(string) }) | |
| const result = oneOfType([withErrors, withoutErrors]) |
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
| { | |
| "scripts": { | |
| "postinstall": "dotnet restore nscreg.Server nscreg.Server.Test", | |
| "eslint": "eslint client client.test run.js webpack.config.js", | |
| "stylelint": "stylelint \"client/components/**/*.pcss\" \"client/pages/**/*.pcss\"", | |
| "lint": "run-p eslint stylelint", | |
| "test": "", | |
| "test:watch": "", | |
| "clean": "node run clean", | |
| "build": "node run build", |
NewerOlder