Skip to content

Instantly share code, notes, and snippets.

Yogesh Agrawal saggiyogesh

Block or report user

Report or block saggiyogesh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
saggiyogesh / extensions.tsx
Created Oct 15, 2019
vscode extensions lists
View extensions.tsx
Bracket Pair Colorizer
Clipboard History
Code Spell Checker
Import Cost
saggiyogesh /
Created Sep 5, 2019 — forked from superseb/
Cleanup host added as custom to Rancher 2.0
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
saggiyogesh /
Created Aug 25, 2019
Bash script to increment no in file name
#!/usr/bin/env bash
set -e
# find existing version of
cd ios;
name=$(ls | grep static)
echo 'grep name: '$name
saggiyogesh / remove-null.js
Created Sep 7, 2018
Remove null, undefined from doc in mongodb. [Terminal code]
View remove-null.js
function getNullKeysRecursively(doc, keyName, nullKeys) {
for (var item_property in doc) {
if (!doc.hasOwnProperty(item_property)) continue;
if (item_property === '_id') continue;
var fullKeyName;
if (keyName) fullKeyName = keyName + '.' + item_property;
saggiyogesh /
Created Aug 9, 2018
Commands for code push RN IOS
  • 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 doing react-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

saggiyogesh / parse.js
Last active Apr 25, 2018
Parsing custom objects in JSON.parse in javascript
View parse.js
// 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) {
let newDoc = JSON.stringify(doc).replace('STRING', '5ab23ff3423159ad5d0251c0');
print('newDoc', newDoc);
let jsonDoc = JSON.parse(newDoc, (key, value) => {
if (value === '5ab23ff3423159ad5d0251c0') {
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
saggiyogesh /
Created Jul 5, 2017
3 Steps to install latest node & npm on Ubuntu.
  • sudo apt-get install npm
  • sudo npm i -g n
  • sudo n latest
  • node -v
saggiyogesh /
Created Mar 6, 2017 — forked from alexellis/
install docker engine for swarm3k on Ubuntu 16.04. 2 options for installing
# option 2: paste this into user-data to automate install via boot script
# NOTE: update --label=owner=YOURNAME below if you want to easily identify yours
# renames the host to have a suffix of alexellisio
export original=$(cat /etc/hostname)
sudo hostname $original-master-alexellisio
echo $original-master-alexellisio | sudo tee /etc/hostname
apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
saggiyogesh / customer.js
Last active Oct 15, 2016
Loopback create computed props from other props.
View customer.js
module.exports = function (Customer) {
Customer.getter['fullname'] = function () {
return `this.firstName this.lastName`.trim()
You can’t perform that action at this time.