Skip to content

Instantly share code, notes, and snippets.

View narwanimonish's full-sized avatar

Monish Narwani narwanimonish

View GitHub Profile
@narwanimonish
narwanimonish / nginx.conf
Created February 8, 2020 13:45
Enable GZip config in Nginx
gzip on;
gzip_disable "msie6";
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
#!/bin/bash
# declare an array called array and define 3 vales
databases=( drupal fresh lasalle_wp_fts )
username=root
password=password
filepath=/home/amitavroy/code/backup
for i in "${databases[@]}"
do
filename=${i}_$(date +"%m%d%Y-%k%M")
mysqldump -u${username} -p${password} ${i} > ${filepath}/${filename}.sql
#!/usr/bin/env bash
funnyCommit() {
commitMessage=$(echo $(curl --silent --fail whatthecommit.com/index.txt))
echo "Your Commit Message is -> ${commitMessage}"
echo "Do you wish to procced with this commit message 😅 (y/n/o = other)?"
old_stty_cfg=$(stty -g)
stty raw -echo ; answer=$(head -c 1) ; stty $old_stty_cfg
if echo "$answer" | grep -iq "^y" ;then
git add -A && git commit -m "${commitMessage}"
@narwanimonish
narwanimonish / delete.sh
Created June 8, 2022 06:19
Deleting un-tagged docker images
#/bin/bash/
docker rmi $(docker images | grep none | awk '{print $3}')
@narwanimonish
narwanimonish / get-quotes-momentum.js
Created July 3, 2022 12:13
Get the list of all quotes from Momentum dashboard using JQuery script
let quotes = [];
$('.cquote').each((i, el) => {
const body = $($(el).find('.cquote-body')[0]).text();
const author = $($(el).find('.cquote-source')[0]).text();
quotes.push(`${body} -- ${author}`)
});
copy(quotes);