Skip to content

Instantly share code, notes, and snippets.

View nk-gears's full-sized avatar
💥
experimenting...

Nirmal nk-gears

💥
experimenting...
View GitHub Profile
@nk-gears
nk-gears / remove-node-modules.md
Last active November 14, 2020 07:02 — forked from lmcneel/remove-node-modules.md
How to remove node_modules after they have been added to a repo

How to remove node_modules

  1. Create a .gitignore file in the git repository if it does not contain one

touch .gitignore

  1. Open up the .gitignore and add the following line to the file

**/node_modules

@nk-gears
nk-gears / bk-tn-events.json
Last active October 10, 2020 07:16
Brahma Kumaris - TN Zone Live Events
[
{
"timestamp":1612121212,
"id":"",
"datetime":"10 Oct 2020 - 6:00 to 7:30 PM IST",
"logo_url":"",
"status":"",
"speaker":"",
@nk-gears
nk-gears / export.js
Created October 9, 2020 12:13
Export Data from Mysql to Multiple CSV Files - page by page
const mysql = require("mysql");
const fastcsv = require("fast-csv");
const Json2csvParser = require("json2csv").Parser;
const fs = require("fs");
var pool = mysql.createPool({
connectionLimit : 10,
host: "host",
user: "root",
password: "",
database: "master",
#!/bin/sh
#
# This script deploys the given manifest,
# tracks the deployment, and rolls back on failure.
#
# First execute this with "myapp.yaml" and then try it with "myapp.failing.yaml"
#
MANIFEST_PATH=$1
DEPLOYMENT_NAME=myapp
const WebSocket = require('ws');
const readline = require('readline');
const url = process.argv[2];
const ws = new WebSocket(url);
ws.on('open', () => console.log('connected'));
ws.on('message', data => console.log(`From server: ${data}`));
ws.on('close', () => {
console.log('disconnected');
@nk-gears
nk-gears / CustomConnector.ps1
Created September 21, 2020 15:48
Validate Custom Connector
using namespace Microsoft.IdentityModel.Clients.ActiveDirectory
[CmdletBinding()]
param (
$tenant,
$username,
$password
)
# Load the latest version of ADAL
@nk-gears
nk-gears / Cloudbuild
Last active June 25, 2020 13:38
CloudBuild Automated Triggers
https://codelabs.developers.google.com/codelabs/cloud-builder-gke-continuous-deploy/index.html#1
cat <<EOF > branch-build-trigger.json
{
"triggerTemplate": {
"projectId": "${PROJECT}",
"repoName": "default",
"branchName": "[^(?!.*master)].*"
},
"description": "branch",
import React, { Component } from "react";
const omit = (obj, omitKey) =>
Object.keys(obj).reduce((result, key) => {
if (key !== omitKey) {
result[key] = obj[key];
}
return result;
}, {});
const overlayStyles = {
@nk-gears
nk-gears / index.js
Created June 6, 2020 13:54 — forked from LaureRC/index.js
Backup cloud function
const { google } = require("googleapis");
const { auth } = require("google-auth-library");
var sqladmin = google.sqladmin("v1beta4");
// Based on https://medium.com/@kennethteh90/how-to-schedule-daily-cloud-sql-export-to-google-cloud-storage-4c1bd360af06
exports.backup = async (_req, res) => {
const authRes = await auth.getApplicationDefault();
let authClient = authRes.credential;
var request = {
@nk-gears
nk-gears / README.md
Created June 6, 2020 13:47
Setup App Registration via Powershell