This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Item { | |
a: string; | |
b: string; | |
constructor(a: string, b: string); | |
constructor(item: {a: string, b: string}); | |
constructor(...args: any[]) { | |
if (args.length === 2) { | |
this.a = args[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash/ | |
docker rmi $(docker images | grep none | awk '{print $3}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing import Pool | |
from multiprocessing import cpu_count | |
import signal | |
stop_loop = 0 | |
def exit_chld(x, y): | |
global stop_loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function PrintElem(elem) | |
{ | |
var mywindow = window.open('', 'PRINT', 'height=400,width=600'); | |
mywindow.document.write('<html><head><title>' + document.title + '</title>'); | |
mywindow.document.write('</head><body >'); | |
mywindow.document.write('<h1>' + document.title + '</h1>'); | |
mywindow.document.write(document.getElementById(elem).innerHTML); | |
mywindow.document.write('</body></html>'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get update -y | |
sudo apt-get remove docker docker-engine docker.io -y | |
sudo apt install docker.io -y | |
sudo systemctl start docker | |
sudo systemctl enable docker | |
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo usermod -aG docker $(whoami) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo su | |
yum update -y | |
amazon-linux-extras install nginx1.12 -y | |
systemctl start nginx | |
echo "Hello from $(hostname -f)" > /usr/share/nginx/html/index.html |
NewerOlder