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;
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active April 7, 2025 16:27
Online Resources For Web Developers (No Downloading)
@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@lucis
lucis / pushingToRepos.ts
Created December 27, 2019 02:27
Creating repositories and pushing files to them using @octokit/rest (GitHub API)
import Octokit from '@octokit/rest'
import glob from 'globby'
import path from 'path'
import { readFile } from 'fs-extra'
const main = async () => {
// There are other ways to authenticate, check https://developer.github.com/v3/#authentication
const octo = new Octokit({
auth: process.env.PERSONAL_ACESSS_TOKEN,
})
@tanishqsh
tanishqsh / freshproject.sh
Created March 4, 2023 05:21
A bash function to create fresh-new NextJS with Tailwind, with my favourite npm packages
function freshproject(){
npx create-next-app@latest "$1" --typescript --eslint
cd "$1"
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
truncate -s 0 tailwind.config.js
echo "module.exports = { content: ['./app/**/*.{js,ts,jsx,tsx}', './pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'], theme: { extend: {},}, plugins: [], };" >> tailwind.config.js
truncate -s 0 styles/globals.css
echo "@tailwind base;" >> styles/globals.css
echo "@tailwind components;" >> styles/globals.css
@adrianhorning08
adrianhorning08 / googleMaps.js
Created August 4, 2023 23:17
Scrape Google Maps
import * as cheerio from "cheerio";
import puppeteerExtra from "puppeteer-extra";
import stealthPlugin from "puppeteer-extra-plugin-stealth";
import chromium from "@sparticuz/chromium";
async function searchGoogleMaps() {
try {
const start = Date.now();
puppeteerExtra.use(stealthPlugin());