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 / -.json
Last active April 12, 2024 10:31
ww test coverage
{"label":"Test Coverage","message":"51.87%","schemaVersion":1,"color":"green","namedLogo":"jest"}
@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 / 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
@pinalbhatt
pinalbhatt / Javascript isNumeric
Last active November 14, 2020 22:00
Javascript isNumeric() function
/*
isNumeric function in Javascript
*/
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
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 / Generate-MachineKey.cs
Last active February 22, 2017 15:34
Generate MachineKey
# Generates a <machineKey> element that can be copied + pasted into a Web.config file.
function Generate-MachineKey {
[CmdletBinding()]
param (
[ValidateSet("AES", "DES", "3DES")]
[string]$decryptionAlgorithm = 'AES',
[ValidateSet("MD5", "SHA1", "HMACSHA256", "HMACSHA384", "HMACSHA512")]
[string]$validationAlgorithm = 'HMACSHA256'
)
process {