Last Update: May 13, 2019
Offline Version
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
""" | |
Sometimes when you run `pip freeze > requirements.txt` when using a conda environment, | |
it spits out the exact locations of the packages on the local machine. | |
This script allows you to run `pip list` instead, and | |
convert the output of `pip list` into the format used by `requirements.txt` files. | |
""" | |
import re |
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/env bash | |
alias ip="dig +short myip.opendns.com @resolver1.opendns.com" # returns public IP address. | |
alias localip="ipconfig getifaddr en0" # returns private/local network DHCP IP address. change to en1 if using ethernet. | |
service_name="mongod" | |
sudo service $service_name status # shows status of service_name. eg: sudo service mongod status |
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
Please provide the AWS S3 Bucket Region: us-east-2 | |
Use AWS Signature Version 4?[Y/n] Y | |
is_aws_signature_v4: True | |
Testing Connection... | |
[OK] Connection To S3 Account | |
[OK] Write Permissions | |
[ERROR] Read Permissions | |
Error Connecting to S3: Please check you have read permissions on the S3 bucket. | |
Details: Traceback (most recent call last): | |
File "/Users/anurags/Projects/DataOps/diffgram/install.py", line 290, in validate_s3_connection |
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
apiVersion: eksctl.io/v1alpha5 | |
availabilityZones: | |
- us-east-2b | |
- us-east-2a | |
- us-east-2c | |
cloudWatch: | |
clusterLogging: {} | |
iam: | |
vpcResourceControllerPolicy: true | |
withOIDC: false |
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
console.log("Hello World"); | |
let id: number = 3.14; | |
let num_name: string = "Pi"; | |
let isRational: boolean = true; | |
let ch: any = 'c' | |
let n = undefined | |
let n2 = null | |
console.log(typeof n) |
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
FROM python:3.9 | |
# https://code.visualstudio.com/docs/remote/containers-advanced#_creating-a-nonroot-user | |
ARG USERNAME=keras-vscode | |
ARG USER_UID=1000 | |
ARG USER_GID=$USER_UID | |
# Create the user | |
RUN groupadd --gid $USER_GID $USERNAME \ | |
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ |
FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
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
""" | |
Mutable vs Immutable objects in Python | |
""" | |
# Numbers are immutable | |
a = 10 | |
b = a | |
b += 1 |
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 subprocess | |
# Run Jupyter notebook server: | |
subprocess.call(["jupyter", "notebook"]) | |
# Install Kernel: | |
# subprocess.call(['ipython', 'kernel', 'install', '--user', '--name=venv']) |
NewerOlder