In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and
returning the cached result when the same
inputs occur again.
— wikipedia
This file contains 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
#!/bin/bash | |
echo "Building NGINX along with Echo module" | |
# install prerequisites | |
yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel | |
# download the Echo module | |
curl -L -O 'https://github.com/openresty/echo-nginx-module/archive/v0.58.tar.gz' | |
tar -xzvf v0.58.tar.gz && rm v0.58.tar.gz | |
mv echo-nginx-module-0.58 /tmp/echo-nginx-module |
This file contains 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
Bracket Pair Colorizer | |
Clipboard History | |
Code Spell Checker | |
ESLint | |
Import Cost |
This file contains 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
#!/bin/sh | |
docker rm -f $(docker ps -qa) | |
docker volume rm $(docker volume ls -q) | |
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke" | |
for dir in $cleanupdirs; do | |
echo "Removing $dir" | |
rm -rf $dir | |
done |
This file contains 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
#!/usr/bin/env bash | |
set -e | |
# find existing version of static.zip | |
cd ios; | |
name=$(ls | grep static) | |
echo 'grep name: '$name |
This file contains 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
function getNullKeysRecursively(doc, keyName, nullKeys) { | |
for (var item_property in doc) { | |
// SKIP BASE-CLASS STUFF | |
if (!doc.hasOwnProperty(item_property)) continue; | |
// SKIP ID FIELD | |
if (item_property === '_id') continue; | |
// FULL KEY NAME (FOR SUB-DOCUMENTS) | |
var fullKeyName; | |
if (keyName) fullKeyName = keyName + '.' + item_property; |
-
Add an app to code-push
code-push app add myiosapp ios react-native
Copy the
Production
deployment key. Use this key when asked in terminal after doingreact-native link code-push
-
Release a build for ios.
code-push release-react myiosapp ios
-
Promote the build to production.
code-push promote myiosapp Staging Production
This file contains 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
// This script is executed in mongo shell to replace all occurence of a STRING, with an objectId string | |
// and then using parse, converting objectId string to actual objectId | |
db.Dummy.find({}).forEach(function(doc) { | |
console.log(doc._id); | |
let newDoc = JSON.stringify(doc).replace('STRING', '5ab23ff3423159ad5d0251c0'); | |
print('newDoc', newDoc); | |
let jsonDoc = JSON.parse(newDoc, (key, value) => { | |
if (value === '5ab23ff3423159ad5d0251c0') { |
This file contains 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
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --restart always portainer/portainer -H unix:///var/run/docker.sock |
NewerOlder