This file contains 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
// Base64 encoded string used for "Application Default Credentials". | |
// Alternative to GOOGLE_APPLICATION_CREDENTIALS env which accepts JSON file path. | |
// | |
// Use following command to generate base64 encoded string for given json file. | |
// $ openssl base64 < ~/Downloads/gcloud-service-key.json | tr -d '\n' | |
// | |
GOOGLE_SERVICE_KEY="<base64_encoded_json_file>" |
This file contains 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
import requests | |
import json | |
import os | |
FILENAME = 'goodquotes.json' | |
def fetchQuotes(): | |
for page in range(1, 101): | |
quotes_on_page = [] | |
url = "https://api.import.io/store/data/cd22ca4b-5d29-4ff3-9c69-cd372563c051/_query?input/webpage/url=https%3A%2F%2Fwww.goodreads.com%2Fquotes%3Fpage%3D" + str(page) + "&_user=2f7d8fb2-391c-4ddf-823c-633134603fc0&_apikey=T67gIWtTHeLU73sx95D8jtFpWs33Qhe7Ym1xn95IxYTvWjyhD5vM9lK0clQVSvaZ%2BRvZilxmHoD0llECgxGE9Q%3D%3D" |
This file contains 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
const React = (() => { | |
// { | |
// 'FooComponent': { | |
// values: [1, 'apple'], | |
// hookIndex: 0, | |
// }, | |
// ... | |
// } | |
let hooks = {}; | |
let componentId = ""; |
This file contains 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
/** Stylebot. */ | |
body > *:not(#stylebot-container) { | |
visibility: hidden; | |
opacity: 0; | |
} | |
html { | |
background: #fff; | |
} |
This file contains 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
@use 'sass:color'; | |
@use 'sass:map'; | |
@use 'sass:selector'; | |
@use 'sass:list'; | |
@use 'sass:math'; | |
@use 'sass:string'; | |
$css-vars: ( | |
'--md-button-container-color', | |
'--md-button-label-text-color', |
This file contains 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
-- show tables | |
\dt | |
-- create a new database | |
# CREATE DATABASE mydb; | |
-- create user | |
# CREATE USER abhinay with password 'secret'; |
This file contains 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
# Backup using MySQL Dump | |
mysqldump --user=root --password=very_strong_password --database mydb > ~/backups/mydb_backup_$(date '+%F_%H%M%S').sql | |
# Restore | |
mysql --verbose --user=root --password=very_strong_password mydb < ~/backups/mydb_backup_2011-06-15_085322.sql |
This file contains 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/python | |
#Author: Abhinay Omkar | |
#Title: Guess Number Game | |
import random | |
class GuessNumber: | |
def startGame(self): | |
print 'Guess a number!' | |
t=0 |
This file contains 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
.css-text { | |
white-space: pre; | |
padding: 8px; | |
font-family: monospace; | |
box-sizing: border-box; | |
font-family: Source Code Pro, monospace; | |
font-size: 0.82rem; | |
} |
NewerOlder