TLDR: Use for...of
instead of forEach()
in asynchronous code.
For legacy browsers, use for...i
or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
require 'openssl' | |
class String | |
def encrypt(key) | |
cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt | |
cipher.key = Digest::SHA1.hexdigest key | |
s = cipher.update(self) + cipher.final | |
s.unpack('H*')[0].upcase | |
end |
composer require cweagans/composer-patches
"extra": {
"magento-force": "override",
"enable-patching": true,
"patches-file": "composer.patches.json"
},
The following is often used as an index for spatial data that needs to be queried | |
with low latency: | |
A SQL database. | |
A geofence. | |
Ans. quadtree. | |
A shard. | |
When designing an API endpoint to list some arbitrary entities, like comments on a | |
video or posts on a news feed, you typically want the endpoint to support: | |
Deletion. |
#include <stdint.h> //for int8_t | |
#include <string.h> //for memcmp | |
#include <wmmintrin.h> //for intrinsics for AES-NI | |
//compile using gcc and following arguments: -g;-O0;-Wall;-msse2;-msse;-march=native;-maes | |
//internal stuff | |
//macros | |
#define DO_ENC_BLOCK(m,k) \ | |
do{\ |
1.Boot the guest with multiple queues(queues=4) nic. | |
e.g:...-device virtio-net-pci,netdev=dev1,mac=9a:e8:e9:ea:eb:ec,id=net1,vectors=9,mq=on | |
-netdev tap,id=dev1,vhost=on,script=/etc/qemu-ifup-switch,queues=4 | |
2.Using ethtool -L enable mq in guest | |
[Guest] # ethtool -L eth0 combined 4 | |
3.Using ethtool -l eth0 can see the channel parameters of the interface like: | |
Pre-set maximums: | |
# ethtool -l eth0 |
#!/usr/bin/env zsh | |
# It is possible to either define direnv_postload as a command, or append | |
# an arbitrary function into the direnv_postload_functions array. | |
typeset -ag direnv_postload_functions | |
_direnv_notify_postload() { | |
local functions=(direnv_postload "${direnv_postload_functions[@]}") | |
local f | |
for f in "${functions[@]}"; do |
*&---------------------------------------------------------------------* | |
*& Report ZZZ | |
*& | |
*&---------------------------------------------------------------------* | |
*& | |
*& | |
*&---------------------------------------------------------------------* | |
REPORT zzz. |