Skip to content

Instantly share code, notes, and snippets.

View iampavangandhi's full-sized avatar
:octocat:
Committing From Home

Pavan Gandhi iampavangandhi

:octocat:
Committing From Home
View GitHub Profile
{"version":1,"resource":"file:///Users/pavangandhi/code/next-myways-admin/apis/AdminDashboard/useGetMainServer.js","entries":[{"id":"oamG.js","timestamp":1651220890797},{"id":"WegD.js","timestamp":1651647498637},{"id":"Lynz.js","timestamp":1651647575641},{"id":"bQLK.js","timestamp":1651647640569}]}
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Add stylelint, eslint and prettier config file
git clone https://github.com/gcnit/code-template.git
# Rename folder to your project name
mv code-template <folder-name>
# Go to folder
cd <folder-name>
# Remove .git folder
@iampavangandhi
iampavangandhi / webpack.config.js
Created April 26, 2021 04:38
Config file for webpack crash course tutorial on youtube, 2021
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './app/index.js',
module: {
rules: [
{
test: /\.svg$/,
use: 'svg-inline-loader',
},
@iampavangandhi
iampavangandhi / Script.js
Created October 5, 2020 05:27
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@iampavangandhi
iampavangandhi / NodeCheerioScraping.js
Created October 5, 2020 05:17
Example to scrape posts and put into a CSV file using Nodejs & Cheerio.
const request = require('request');
const cheerio = require('cheerio');
const fs = require('fs');
const writeStream = fs.createWriteStream('post.csv');
// Write Headers
writeStream.write(`Title,Link,Date \n`);
request('http://codedemos.com/sampleblog', (error, response, html) => {
if (!error && response.statusCode == 200) {
@iampavangandhi
iampavangandhi / NodeRedisCache.js
Last active October 5, 2020 05:15
Node.js Redis Caching
const express = require('express');
const fetch = require('node-fetch');
const redis = require('redis');
const PORT = process.env.PORT || 5000;
const REDIS_PORT = process.env.PORT || 6379;
const client = redis.createClient(REDIS_PORT);
const app = express();
@iampavangandhi
iampavangandhi / django_deploy.md
Created October 5, 2020 05:11 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@iampavangandhi
iampavangandhi / ssh.md
Created October 5, 2020 05:11 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh [email protected]

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@iampavangandhi
iampavangandhi / docker-help.md
Created October 5, 2020 05:10 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info