Skip to content

Instantly share code, notes, and snippets.

View pinalbhatt's full-sized avatar
💭
from the desk of Pinal Bhatt

Pinal Bhatt pinalbhatt

💭
from the desk of Pinal Bhatt
View GitHub Profile
@pinalbhatt
pinalbhatt / cargo.sh
Last active December 4, 2022 12:00
Commands
cat $CARGO_HOME/.crates.toml
cat $CARGO_HOME/.crates2.json | jq .
cargo install --list
cargo install -f cargo-upgrades
rustup update
@pinalbhatt
pinalbhatt / products.js
Created March 17, 2021 15:13
IAP-MongoDB
db.getCollection("products").find({
app: 'ios',
market: 'pt-BR',
programId: '32135'
});
db.getCollection("products").findOneAndUpdate({
app: 'ios',
market: 'pt-BR',
programId: '32135'
@pinalbhatt
pinalbhatt / -.json
Last active November 14, 2024 20:14
ww test coverage
{"label":"Test Coverage","message":"51.87%","schemaVersion":1,"color":"green","namedLogo":"jest"}
@pinalbhatt
pinalbhatt / script.sh
Created February 6, 2021 10:24
Node Setup on Mac
brew install node
mkdir "${HOME}/.npm-packages"
echo NPM_PACKAGES="${HOME}/.npm-packages" >> ${HOME}/.bashrc
echo prefix=${HOME}/.npm-packages >> ${HOME}/.npmrc
echo NODE_PATH=\"\$NPM_PACKAGES/lib/node_modules:\$NODE_PATH\" >> ${HOME}/.bashrc
echo PATH=\"\$NPM_PACKAGES/bin:\$PATH\" >> ${HOME}/.bashrc
echo source "~/.bashrc" >> ${HOME}/.bash_profile
source ~/.bashrc
CREATE STREAM "my-stream1"
(data STRUCT<
EmailTemplateName VARCHAR,
EmailAddress VARCHAR>,
maskEmail VARCHAR,
market VARCHAR)
WITH (kafka_topic='growthnonprod-signup-api-emails-dev', value_format='json');
select data->EmailTemplateName as EmailTemplateName, data->EmailAddress as EmailAddress, maskEmail, market from "my-stream1" EMIT CHANGES;
@pinalbhatt
pinalbhatt / slack.json
Created April 13, 2020 09:24
slack GHA notification
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":github: Actions - *predefined message*:\ncat - info, error, broadcast"
},
"accessory": {
"type": "image",
@pinalbhatt
pinalbhatt / gist:f981678b4a3f08675212992e0591a9a8
Created August 11, 2017 12:39 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@pinalbhatt
pinalbhatt / index.html
Created February 26, 2017 19:21 — forked from sommereder/index.html
IPC Renderer Service for Electron/Angular2
<script>
const electron = require('electron');
// below is just plain angular stuff
System
.config({
packages: {
angular: {
format: 'register',
defaultExtension: 'js'
@pinalbhatt
pinalbhatt / Logger.js
Last active October 14, 2016 13:51
SignupAPI-Logger
// Logger
// global object: Log
/**
* writes logs
* @param {String} cat - Short string for loggly filter
* @param {String} message
* @param {Object} data
* @param {Object} wwContext
* @param {string} file filename
@pinalbhatt
pinalbhatt / 0_reuse_code.js
Created February 13, 2016 12:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console