sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
A brief example on how to use npx
to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/ or watch it on YouTube https://www.youtube.com/watch?v=fSHWc8RTJug
// Input: [ | |
// "J", | |
// "o", | |
// "i", | |
// "n", | |
// " ", | |
// "U", | |
// "s", | |
// " ", | |
// "N", |
async function asyncFlatMap (arr, asyncFn) { | |
return Promise.all(flatten(await asyncMap(arr, asyncFn))) | |
} | |
function asyncMap (arr, asyncFn) { | |
return Promise.all(arr.map(asyncFn)) | |
} | |
function flatMap (arr, fn) { | |
return flatten(arr.map(fn)) |
<?php | |
/** | |
* Programmatically install and activate wordpress plugins | |
* | |
* Usage: | |
* 1. Edit the $pluginSlugs array at the beginning of this file to include the slugs of all the | |
* plugins you want to install and activate | |
* 2. Upload this file to the wordpress root directory (the same directory that contains the | |
* 'wp-admin' directory). | |
* 3. Navigate to <your-domain-wordpress-root>/install-wp-plugins.php (If wordpress is installed |
## Global install of the app generator | |
npm install -g create-react-app | |
## Setup the app (first-time only) | |
create-react-app my-app | |
cd my-app | |
git init | |
# Create the Heroku app; requires free account at https://www.heroku.com/ | |
heroku create -b https://github.com/heroku/heroku-buildpack-static.git |
A quick guide on how to setup Node.js development environment.
nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/ | |
// See also: http://www.paulund.co.uk/change-url-of-git-repository | |
$ cd $HOME/Code/repo-directory | |
$ git remote rename origin bitbucket | |
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git | |
$ git push origin master | |
$ git remote rm bitbucket |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |