Skip to content

Instantly share code, notes, and snippets.

View duncangh's full-sized avatar
💭
👨‍💻

Graham Duncan duncangh

💭
👨‍💻
View GitHub Profile
@duncangh
duncangh / investing.py
Created April 1, 2023 05:00 — forked from elibroftw/investing.py
A Python script and tool for speeding up stock market research.
"""
Investing Quick Analytics
Author: Elijah Lopez
Version: 1.49
Created: April 3rd 2020
Updated: March 16th 2021
https://gist.github.com/elibroftw/2c374e9f58229d7cea1c14c6c4194d27
Resources:
Black-Scholes variables:
@duncangh
duncangh / developer-blogs.md
Created May 20, 2022 00:41
Might fuck around and make a list of developer blogs cuz my bookmarks are a nightmare

Developer blogs I've found and like

Individual run websites, so will exclude examples like "Netflix Engineering Blog" etc

  • todo: export chrome bookmarks and make the links pretty with markdown
  • todo: get more than one so this doesn't look like another abandoned project in my gist graveyard

https://www.craigkerstiens.com/ https://simonwillison.net/

import requests
import pandas as pd
import plotly.graph_objects as go
import pandas as pd
from datetime import datetime
api_key = 'your api key from financialmodelingprep'
@duncangh
duncangh / jinja-example.json
Last active November 11, 2021 00:09 — forked from sevennineteen/example.json
Example using Jinja2 to populate a JSON payload template
{ "path": "/content/geometrixx/my-first-jinja-page",
"properties": [
{ "name": "jcr:primaryType",
"value": "cq:Page" }],
"nodes": [
{ "path": "jcr:content",
"properties": [
{ "name": "jcr:primaryType",
"value": "cq:PageContent"},
@duncangh
duncangh / Collect Parler Metadata.ipynb
Created January 12, 2021 06:37 — forked from kylemcdonald/Collect Parler Metadata.ipynb
Collect video URLs and GPS data for Parler videos.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@duncangh
duncangh / README.md
Created October 17, 2020 02:54 — forked from parente/README.md
Jupyter Tidbit: Display an image gallery

Summary

JupyterLab and Jupyter Notebook can display HTML-embedded images in notebook documents. You can use the IPython.display.HTML class to structure these images into a basic image gallery.

Example

Binder

The notebook below defines a gallery() function that accepts a list of image URLs, local image

@duncangh
duncangh / an_oop_umph_concert_simulator.py
Last active October 2, 2020 01:24
Umphreys Songs and frequencies
import random
import pandas as pd
import numpy as np
# import requests
# from bs4 import BeautifulSoup as bs
# base_setlist_url = "https://allthings.umphreys.com/setlists/2020.html"
df= pd.read_csv('https://gist.githubusercontent.com/duncangh/f732e79528c809c6affcfcbfaa087cba/raw/393a5861d749b0f1b60879038ce70eca99fe3517/songs.csv')
@duncangh
duncangh / leetcode_retag.md
Created August 2, 2020 02:11 — forked from Windsooon/leetcode_retag.md
Retag most popular Leetcode problems
// scroll to bottom
function autoScrolling() {
window.scrollTo(0,document.body.scrollHeight);
}
var refreshIntervalId = setInterval(autoScrolling, 5);
// run to cancel
clearInterval(refreshIntervalId);
@duncangh
duncangh / zillow.py
Created June 18, 2020 02:56 — forked from scrapehero/zillow.py
Python 3 script to find real estate listings of properties up for sale on zillow.com
from lxml import html
import requests
import unicodecsv as csv
import argparse
import json
def clean(text):
if text:
return ' '.join(' '.join(text).split())