// GET request
fetch('https://example.com/data')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error))
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
| # instructions: place images in same directory as this file. Run the file. | |
| from PIL import Image | |
| import pyocr | |
| import pyocr.builders | |
| import os | |
| # Print the list of png files | |
| def get_images_list(): | |
| # Get the list of all files in the current directory |
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
| # Logs | |
| logs | |
| *.log | |
| npm-debug.log* | |
| yarn-debug.log* | |
| yarn-error.log* | |
| lerna-debug.log* | |
| # Diagnostic reports (https://nodejs.org/api/report.html) | |
| report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json |
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
| # Context for exclusion | |
| # 1. For excluding files, use .gitignore as hint. | |
| # 2. Soft exclusion - Don't copy .gitignore blindly. IDE settings are still. | |
| # .gitignore syntax - MEGAsync exclusion syntax | |
| # 1. /dirName - dirName - directory exclusion | |
| # 2. dir1/dir2 - */dir1/dir2 - MEGAsync is not consistent with exclusion syntax | |
| # Tip - Delete all files to be excluded before settings the exclusion. | |
| # Otherwise the excluded file will have a single stagnant instance in the cloud. |
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
| import unittest | |
| class PlaneSeating: | |
| def __init__(self, seat_block_column_n_row, number_of_passsengers): | |
| self.seat_block_column_n_row = seat_block_column_n_row | |
| self.number_of_passsengers = number_of_passsengers | |
| # calculate number of seats of each type |
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
| ### EC2 restart | |
| If your server is restarted, its public IPv4 address may change, in that case, | |
| just update the `Route 53` type A record with the new address. |
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
| # ~/.gitconfig - the global config | |
| [user] | |
| name = Sanjar Afaq | |
| email = [email protected] | |
| [includeIf "gitdir:~/volopay-work/"] | |
| path = ~/volopay-work/.gitconfig | |
| [core] | |
| editor = code --wait |
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
| The contents of this repo are placed at ~/.dotfiles. | |
| The idea is to quickly install/uninstall/edit dot files. | |
| It also contains env files (with the actual values being hidden). |
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
| .vscode |