const WebpackBar = require('webpackbar'); module.exports = { // Otras configuraciones... plugins: [ new WebpackBar() ] };
--progress
npx webpack --config ./webpack.config.core.js --progress
npm list webpack
find_or_initialize_by
method is a convenient way to find a record in a database based on certain conditions and, if not found, initialize a new instance of the model with those conditions set.# Example usage @user = User.find_or_initialize_by(email: 'example@example.com')
types
are indexed by the default whereas interfaces
are not. It makes interfaces
more safe. type Admin = { name: string, privileges: string[] } type Employee = { name: string, startDate: Date } type CombinedType = Admin & Employee; interface CombinedInterface extends Admin, Employee { } const interfaceData: CombinedInterface = { name: '', privileges: [], startDate: new Date() } const typeData: CombinedType = { name: '', privileges: [], startDate: new Date() } const handleType = (obj: Record<string, unknown>) => { obj['name'] = 42 // unsafe } handleType(interfaceData) // error handleType(typeData) // ok
process.nextTick
is a Node.js feature that defers the execution of a callback function to the next iteration of the event loop. It's often used when immediate execution is necessary, but the function should be deferred to avoid blocking the event loop. For example, in scenarios where you want to ensure that certain asynchronous operations are complete before continuing, process.nextTick
can be employed.git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch <path to the file or directory>' --prune-empty --tag-name-filter cat -- --all
pip3 install git-filter-repo
git filter-repo --path <path to the file or directory> --invert-paths
git filter-branch --env-filter ' OLD_EMAIL="old-test@test.com" CORRECT_NAME="Oswaldo Pineda" CORRECT_EMAIL="new-test@test.com" if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] then export GIT_COMMITTER_NAME="$CORRECT_NAME" export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" fi if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ] then export GIT_AUTHOR_NAME="$CORRECT_NAME" export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" fi ' --tag-name-filter cat -- --branches --tags
memo
lets you skip re-rendering a component when its props are unchanged.memo
to get a memoized version of that component. This memoized version of your component will usually not be re-rendered when its parent component is re-rendered as long as its props have not changed. But React may still re-render it: memoization is a performance optimization, not a guarantee.import { memo } from 'react';
const SomeComponent = memo(function SomeComponent(props) {
// ...
});
npm show
command is used to display detailed information about a package available on the npm registry. npm show
command:npm show <package-name>
npm show
retrieves information directly from the npm registry, so it doesn't require the package to be installed locally. It's a convenient way to inspect package details before deciding to install or use a particular version.