Skip to content

Instantly share code, notes, and snippets.

View gaurangrshah's full-sized avatar
💭
🚀

gshah2020 gaurangrshah

💭
🚀
View GitHub Profile
@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();
// Based on https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js
// and https://tailwindcss.com/components
export const borderWidths = {
px: '1px',
'0': '0',
'2': '2px',
'4': '4px',
'8': '8px',
}
@gaurangrshah
gaurangrshah / .gitignore
Created April 3, 2020 02:47
python .gitignore
# Editors
.vscode/
.idea/
# Vagrant
.vagrant/
# Mac/OSX
.DS_Store
@gaurangrshah
gaurangrshah / app.py
Last active April 22, 2020 06:22
flask-hello-app
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__) # instantiate flask application
app.route('/') # listens for requests on the index route.
def index(): # index route handler
return "Hello World"
@gaurangrshah
gaurangrshah / setup.sh
Last active April 22, 2020 06:22
flask-boiler-setup.sh
#!/bin/sh
export ENV='dev'
export FLASK_APP=app.py
export FLASK_DEBUG=true
python3 -m venv venv
source venv/bin/activate
flask run --reload
@gaurangrshah
gaurangrshah / iterm-profile.json
Created April 22, 2020 18:07
iterm2 profile config
{
"Ansi 3 Color" : {
"Green Component" : 0.73333334922790527,
"Blue Component" : 0,
"Red Component" : 0.73333334922790527
},
"Tags" : [
],
"Ansi 12 Color" : {
@gaurangrshah
gaurangrshah / auth0.html
Created May 1, 2020 23:19
auth0-default-login.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Sign In with Auth0</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<style>
@gaurangrshah
gaurangrshah / gmapsListingScraper.js
Created May 10, 2020 01:53
Google Maps Listings Scraper
function JSONToCSVConvertor(JSONData, ReportTitle, ShowLabel) {
// http://jsfiddle.net/d7n0hj6k/1/
//If JSONData is not an object then JSON.parse will parse the JSON string in an Object
var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData;
var CSV = '';
//Set Report title in first row or line
CSV += ReportTitle + '\r\n\n';
@gaurangrshah
gaurangrshah / .gitpod.Dockerfile
Last active May 15, 2020 02:54
gitpod dockerfile
FROM gitpod/workspace-full
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "zsh"]
USER gitpod
RUN sudo apt-get update && \
sudo apt-get install -y zsh
@gaurangrshah
gaurangrshah / quicklook.md
Created September 11, 2020 20:46
OSX QuickLook Plugins

view image sizes in quicklook: brew cask install qlimagesize mdimagesizemdimporter

webp quicklook preview brew cask install WebPQuickLook

markdown quicklook brew cask install qlmarkdown

quicklook json