Skip to content

Instantly share code, notes, and snippets.

View gaurangrshah's full-sized avatar
💭
🚀

gshah2020 gaurangrshah

💭
🚀
View GitHub Profile
@gaurangrshah
gaurangrshah / animatedScrollTo.js
Created July 14, 2018 23:39 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@gaurangrshah
gaurangrshah / webdev_online_resources.md
Created July 17, 2018 02:13 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@gaurangrshah
gaurangrshah / wpmin .gitignore
Last active October 10, 2020 06:09 — forked from esamattis/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@gaurangrshah
gaurangrshah / docker-wordpress.sh
Created February 5, 2019 20:28 — forked from tatemz/docker-wordpress.sh
A quick way to get a WordPress installation up and running with Docker
#!/bin/bash
mkdir wordpress-site && cd wordpress-site
touch docker-compose.yml
cat > docker-compose.yml <<EOL
version: "2"
services:
my-wpdb:
@gaurangrshah
gaurangrshah / string-utils.js
Last active April 12, 2021 18:49 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
export function unPluralize(str = "") {
// @SCOPE: if a string ends in a 's' we simple remove the 's'
if (!str) return;
str = str?.toLowerCase();
@gaurangrshah
gaurangrshah / Image.tsx
Created December 5, 2020 18:37
Integrate NextJs `next/image` with Chakra-UI styling
import { chakra, ThemingProps, useStyleConfig } from '@chakra-ui/react'
import NextImage, { ImageProps as NextImageProps } from 'next/image'
import { ReactElement } from 'react'
/**
* ? Because NextJs typing is preventing auto-suggest for layout, width and height
* ? we declare the styles differently in this component and will manage the switch
* ? to NextJs typings when calling NextJs Image component
*/
type LayoutValue = 'fixed' | 'intrinsic' | 'responsive' | undefined
@gaurangrshah
gaurangrshah / jslike.code-snippets
Created March 4, 2021 00:49 — forked from kourge/jslike.code-snippets
a VS Code snippet for typing in JS imports module-first, like the order in Python
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
"Named import": {
"scope": "javascript,javascriptreact,typescript,typescriptreact",
"prefix": "from",
@gaurangrshah
gaurangrshah / dataMiner.js
Created June 15, 2021 17:58 — forked from Harshmakadia/dataMiner.js
twitter-analytics-data-scraper
// 1. Go to https://analytics.twitter.com/
// 2. Keep scrolling till the end until all the stats data is loaded
// 3. Right click on page click on last option "Inspect" a window should open select console from that
// 4. copy this entire function
function dataMiner(){
let masterArray = [];
#!/bin/bash
# This script will download the contents of a GitHub repo
# and place them in a local directory.
#
# Usage:
# download-repo.sh <repo> <output-path> <nested-path>
#
# Example:
# download-repo.sh wattenberger/kumiko ./kumiko-assets public/assets