Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
from the desk of Pinal Bhatt

Pinal Bhatt pinalbhatt

💭
from the desk of Pinal Bhatt
View GitHub Profile
View products.js
db.getCollection("products").find({
app: 'ios',
market: 'pt-BR',
programId: '32135'
});
db.getCollection("products").findOneAndUpdate({
app: 'ios',
market: 'pt-BR',
programId: '32135'
View account-apis-heads_main.json
{"schemaVersion":1,"label":"Test Coverage","message":"56.36%","color":"green","namedLogo":"jest"}
@pinalbhatt
pinalbhatt / script.sh
Created Feb 6, 2021
Node Setup on Mac
View script.sh
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
View KsqlDB.sql
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 Apr 13, 2020
slack GHA notification
View slack.json
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":github: Actions - *predefined message*:\ncat - info, error, broadcast"
},
"accessory": {
"type": "image",
View gist:f981678b4a3f08675212992e0591a9a8
# 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 Feb 26, 2017 — forked from sommereder/index.html
IPC Renderer Service for Electron/Angular2
View index.html
<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 Oct 14, 2016
SignupAPI-Logger
View Logger.js
// 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 Feb 13, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pinalbhatt
pinalbhatt / gist:2fc114f817a1d294e6ea
Last active Sep 12, 2015 — forked from cakebaker/gist:823574
Nicer interface for removing query string params with Node.js
View gist:2fc114f817a1d294e6ea
var urlLib = require('url');
function UrlAdapter(urlString) {
this.urlObj = urlLib.parse(urlString, true);
// XXX remove the search property to force format() to use the query object when transforming the url object to a string
delete this.urlObj.search;
}
exports.UrlAdapter = UrlAdapter;