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 / php-server-with-wordpress.md
Created March 26, 2020 11:24 — forked from edheltzel/php-server-with-wordpress.md
Using PHP's built in server for WordPress development.

Preface

So in the past, I've used MAMP/MAMP Pro apps and others alike. I've also, setup my own local MAMP stack with homebrew, that used dnsmasq to dynamically add vhosts anytime I added a new folder to the Sites folder which made it very convenient. But, then I started running into other environment issues with PHP versions on remote machines/servers not being updated or some other crazy thingamabob breaking. I researched and invested time in Vagrant, but that seem to break more often than my homebrew setup. So I researched again investing time into Docker via Docker for Mac (which is BAMF), which I'm sold on and use daily, but it still seems a little bleeding edge and not so simple to wrap your head around the concept. Not to mention I don't have a real use case to play with and take advantage of all the features that come packed with Docker.

This is the beginning of trying to find something more simple, and slightly quicker to setup.

@nk-gears
nk-gears / write-two-millio-rows-of-csv-data-with-node-cluster.js
Created April 2, 2020 11:21 — forked from midnightcodr/write-two-millio-rows-of-csv-data-with-node-cluster.js
How to write two million rows of csv data using faker.js and node cluster
const faker = require('faker')
// const N = 30
const N = 2000000
const fs = require('fs')
const record = () => {
// faker.fake(
// '{{name.lastName}},{{name.lastName}},{{address.city}},{{address.county}},{{address.zipCode}},{{hacker.adjective}}\n'
return [
faker.name.firstName(),
faker.name.lastName(),
@nk-gears
nk-gears / StorageAccountDefaultKey.json
Last active June 6, 2020 13:50 — forked from eNeRGy164/LoremIpsumKeyVault.json
Adding default Blob Key to KeyVault
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.KeyVault/vaults",
"name": "LoremVault",
"apiVersion": "2015-06-01",
"location": "[resourceGroup().location]",
"properties": {
@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 = {
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 = {
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');
#!/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
@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 / INSTALL_GOLANG_1.13.4_AMI_LINUX.md
Created October 31, 2020 06:20 — forked from riandyrn/INSTALL_GOLANG_1.13.4_AMI_LINUX.md
[Install Golang 1.13.4 on AMI Linux]

Install Golang

cd /usr/local/
sudo wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
sudo tar -xzf go1.13.4.linux-amd64.tar.gz

Append Golang Binary to Path