Skip to content

Instantly share code, notes, and snippets.

@misterhay
misterhay / resume_parse.py
Created August 14, 2020 17:18
Code for getting started with resume parsing and feedback
doc_url = ''
buzzwords = ['education','training','experience']
doc_id = doc_url.split('/')[5]
export_url = 'https://docs.google.com/document/d/'+doc_id+'/export?format=txt'
import requests
try:
r = requests.get(export_url)
except:
print('Make sure your Doc is shared as "anyone with the link" and that you have pasted the link correctly between the quotes')

Levels of Data Science Comfort

This is a self-assessment tool, which of the following code snippets do you think you could have written?

  1. I have never seen any of this before.

  2. Creating a Data Frame

import pandas as pd
df = pd.read_html('https://en.wikipedia.org/wiki/List_of_missions_to_Mars')[0]
@misterhay
misterhay / levels-of-python-comfort.md
Last active July 7, 2020 17:07
A self-assessment tool to help identify your Python comfort level.

Levels of Python Comfort

This is a self-assessment tool, which of the following code snippets do you think you could have written?

  1. I have never seen any Python before.

  2. Basics

print('Hello World')
@misterhay
misterhay / button-check.py
Last active June 18, 2020 18:23
Check if notebook button code is correctly formatted (for Open in Callysto button)
import os
import json
import pandas as pd
# create an empty data frame
df = pd.DataFrame(columns=['Name','First'])
# loop through the files and folder to find notebook files
for root, dirs, files in os.walk("."):
for filename in files:
if filename.endswith('.ipynb'):
if not 'checkpoint' in filename:
@misterhay
misterhay / template.ipynb
Created June 9, 2020 21:15
A Jupyter notebook template for the Callysto project
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#! /usr/bin/env python3
stream_key = 'xxxx-xxxx-xxxx-xxxx'
recording_path = '/home/username/Videos'
ffmpeg_path = ''
print("If you haven't started the recording already, press Ctrl-c to cancel this...")
from datetime import datetime
from pathlib import Path
import os
#include <Adafruit_NeoPixel.h> // https://github.com/adafruit/Adafruit_NeoPixel
const int dataPin = 6; // Arduino PWM data pin D6
const int pixels = 30; // number of Neopixels
Adafruit_NeoPixel strip = Adafruit_NeoPixel(pixels, dataPin, NEO_GRB + NEO_KHZ800);
#include <ClickEncoder.h> // https://github.com/0xPIT/encoder/tree/arduino
#include <TimerOne.h> // https://playground.arduino.cc/Code/Timer1/
ClickEncoder *encoder;
int16_t last, value;
void timerIsr() {
@misterhay
misterhay / online-learning-with-open-source-tools.html
Created May 27, 2020 17:39
Online learning with open source tools
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
@misterhay
misterhay / pandas-cheatsheet.md
Last active July 20, 2022 15:23
Pandas cheatsheet, syntax of common commands

Pandas Cheatsheet

import pandas as pd

Creating a DataFrame

from online data

@misterhay
misterhay / turtle-writing-misterhay.py
Created March 20, 2020 19:49
Python code for a turtle in a Jupyter notebook to write out MISTERHAY
from mobilechelonian import Turtle
t = Turtle()
t.speed(10)
full = 80
half = full/2
quarter = half/2
diagonal = full*0.707
spacing = 10