This pseudo code
section.solutions.flex-columns>.row>.column*2
Will become this code
<section class="solutions flex-columns">
<div class="row">
This pseudo code
section.solutions.flex-columns>.row>.column*2
Will become this code
<section class="solutions flex-columns">
<div class="row">
console.clear() | |
const { matchPath } = require('react-router-dom'); | |
const { isNil, trim, flow, identity } = require('lodash'); | |
const patterns = [ | |
{ path: '/' }, | |
{ path: '/new' }, | |
{ path: '/dashboard' }, | |
{ path: '/details/:claimId' }, |
console.clear() | |
// https://www.codegrepper.com/code-examples/javascript/javascript+generate+unique+hash | |
const hash = (len) => '_' + Math.random().toString(len).substr(2, 9) | |
const hashes = (amount = 5, hashLength = 36) => new Array(amount).fill().map(e => hash(hashLength)) | |
console.log(hashes(100)) |
console.clear() | |
const R = require('ramda') | |
const person = require('../data/lenses.arrays') | |
// Not correct -------------------------------------------------------- | |
const getThirdFriend_incorrect = R.pipe( | |
R.lensProp('friends'), | |
R.lensIndex(2) | |
) | |
const result_incorrect = R.view(getThirdFriend_incorrect, person) |
console.clear() | |
const R = require('ramda') | |
const cart = [ | |
{ name: 'apples', price: 2.49 }, | |
{ name: 'soap', price: 1.99 }, | |
{ name: 'milk', price: 2.99 }, | |
{ name: 'eggs', price: 3.99 }, | |
{ name: 'carrots', price: 2.99 }, |
/* eslint-disable no-prototype-builtins */ | |
import Overrides from './overrides'; | |
import Themed from './theme'; | |
import Main from './default'; | |
const handler = { | |
get: (target: any, name: string): any => (target.hasOwnProperty(name) ? target[name] : Main), | |
}; | |
const mapping = { |
console.clear() | |
// trampoline | |
const Bounce = (f, x) => ({ isBounce: true, f, x }) | |
const Done = x => ({ isBounce: false, x }) | |
const trampoline = ({ isBounce, f, x }) => { | |
while (isBounce) | |
({ isBounce, f, x } = f(x)) | |
return x |
# Revert to an old commit | |
git revert --no-commit 0766c053..HEAD |
I can't tell others how to write their libraries so that I can understand them easier. That's a given. That's also nonsense. I can do this with code at work though (which I do all the time). What I can do is learn how to read these things better. So I can decipher how others write their code.
But if you read the docs or take a bunch of courses you might not come away with a better understanding. I think it's just fine if your use cases are regular imperative code. When things are curried and you can write a signature for a function as a type within a type that's when things get more difficult.
And honestly, that's where I like to live. So it's time to do a little learning.
I was having issues with complex TypeScript generics/types. I wanted to figure out what was going on with the following function signature. I'm not used to generics espcially complicated ones. I'm fully aware that there are even more complicated ones but this isn't a dick measuring
https://gyandeeps.com/console-stubbing/ |