module.exports = {
username: 'postgres',
password: 'password',
database: 'diary',
dialect: 'postgres',
protocol: 'postgres',
port: 5432,
host: '127.0.0.1'
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
{ | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true | |
} | |
}, | |
"extends": [ | |
"airbnb", | |
"prettier", |
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
mod sort_fn { | |
pub fn bubble_sort<T: Ord>(victim: &mut [T]) { | |
for _ in 0..victim.len() { | |
for j in 1..victim.len() { | |
if victim[j - 1] > victim[j] { | |
victim.swap(j - 1, j); | |
} | |
} | |
} | |
} |
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 data = [4, 3, 5, 0, 1, 10, 8, 2, 9] | |
function insertedSort(data) { | |
for (let i = 0; i < data.length; i++) { | |
for (let j = i; j > 0 && data[j] < data[j - 1]; j--) { | |
[data[j], data[j - 1]] = [data[j - 1], data[j]] | |
} | |
} | |
return data | |
} |
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 { resolve } = require('path'); | |
const { | |
LoaderOptionsPlugin, | |
EnvironmentPlugin, | |
HotModuleReplacementPlugin, | |
} = require('webpack'); | |
const merge = require('webpack-merge'); | |
const { config, loadersConfig, DIST } = require('./shared'); |
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 getValue = (form, fieldName) => form[fieldName] | |
const form = { | |
firstName: 'dima', | |
lastName: 'shelomanov' | |
} | |
const curry = (fn, ...args) => | |
(...currentArgs) => { | |
const allArgs = [...args, ...currentArgs] |
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 compose = (...funcs) => | |
funcs.reduce((a, b) => (...args) => a(b(...args)), arg => arg) |
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 {action1, action2} from "myActions"; | |
import {bindActionCreators} from "redux"; | |
import {connect} from "react-redux"; | |
const mapStateToProps = (state, ownProps) = { | |
return { | |
counter : state.counter, | |
someComponentValue : state.things[ownProps.someIdProp] | |
}; | |
} |
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
// | |
// Call this function and pass in the name of the font you want to check for availability. | |
// | |
function doesFontExist(fontName) { | |
// creating our in-memory Canvas element where the magic happens | |
var canvas = document.createElement("canvas"); | |
var context = canvas.getContext("2d"); | |
// the text whose final pixel size I want to measure | |
var text = "abcdefghijklmnopqrstuvwxyz0123456789"; |
NewerOlder