Skip to content

Instantly share code, notes, and snippets.

@dcbark01
dcbark01 / install.sh
Created April 22, 2019 20:59
Automated install of Anaconda3 on AWS EC2 and setup of AWS CLI/Boto3
#!/usr/bin/env bash
# ---------------------------- INSTALL NOTES ----------------------------
# To properly setup the AWS CLI, make sure that this shell script is run with the two required positional args:
# $1 :: (string) AWS Access Key ID
# $2 :: (string) AWS Secret Key
#
# Also make sure to give the script permission to run!:
# chmod 755 /home/ec2-user/install.sh
#
@killertilapia
killertilapia / python_csv.py
Last active December 16, 2021 03:20
Reading and Writing CSV Files in Python
"""
Assuming our CSV file (employee_birthday.csv) has the contents of
name,department,birthday month
John Smith,Accounting,November
Erica Meyers,IT,March
"""
# Reading CSV Files with csv
@discdiver
discdiver / jupyterlab_shortcuts.md
Last active May 11, 2025 10:19
Common Jupyter Lab Keyboard Shortcuts

If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cell or cells - if no cells below, insert a code cell below

  • Ctrl + B toggle hide/show left sidebar

  • Ctrl + S save and checkpoint

  • Ctrl + Shift + S save as

@huytung228
huytung228 / mean_avg_precision.py
Created August 15, 2021 05:09
Calculate mAP object detection
import torch
from collections import Counter
from iou import intersection_over_union
def mean_average_precision(
pred_boxes, true_boxes, iou_threshold=0.5, box_format="midpoint", num_classes=20
):
"""
Calculates mean average precision
@danielgross
danielgross / mathpix2gpt.py
Last active March 18, 2025 02:18
mathpix2gpt.py
import requests
import time
import os
import sys
import openai
import tiktoken
from termcolor import colored
openai.api_key = open(os.path.expanduser('~/.openai')).read().strip()