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
// <copyright file="FileNamesEncoder.cs" company="none"> | |
// All is OK, guys! It's just a StyleCop-ism | |
// </copyright> | |
// <author>code4aman</author> | |
namespace FileNamesEncoder | |
{ | |
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Text; |
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
{ | |
test: /\.(css|pcss)/, | |
use: [ | |
'style', | |
{ | |
loader: 'css', | |
options: { | |
importLoaders: 1, | |
sourceMap: isDebug, | |
modules: true, |
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
{ | |
"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", |
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
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 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 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 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 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 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 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> |
OlderNewer