Skip to content

Instantly share code, notes, and snippets.

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

Graham Duncan duncangh

💭
👨‍💻
View GitHub Profile
@yongghongg
yongghongg / stock_screener.py
Last active October 19, 2024 06:01
Build your own technical analysis stock screener using Python
#import required modules
from bs4 import BeautifulSoup
import ast
import pandas as pd
import re
import requests
from datetime import datetime
def get_stock_price(ticker):
# pass a ticker name to i3investor website url
@kylemcdonald
kylemcdonald / Collect Parler Metadata.ipynb
Last active July 27, 2025 17:52
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.
@divyajyotiuk
divyajyotiuk / get_twitter_bookmarks.py
Last active February 10, 2024 05:40
Python code to get text and link of the bookmarked tweets and save in markdown
import json
import glob
all_bookmarks = []
md_file = open("bookmarks.md", "w+") # saving in markdown file, if no file exists using '+' creates one
files = [file for file in glob.glob("JSONBookmarks/*")] # using glob to read all files from the folder
for file_name in files:
print(file_name)
with open(file_name) as bk:
@jph00
jph00 / py_stdlib.md
Last active October 23, 2025 03:44
Hyperlinked index to every module, function, and class in the Python standard library

All of the python 3.9 standard library

(Too big for a single gist, so see first reply for the rest)

Table of contents

@jph00
jph00 / py.md
Last active May 31, 2022 06:16
Organized and hyperlinked index to every module, function, and class in the Python standard library

All of the python 3.9 standard library

For a version without the collapsible details sections (so you can search the whole thing in your browser), click here.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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')
@kcwinner
kcwinner / app.py
Last active October 13, 2023 04:59
Call AppSync GraphQL from Python Lambda Function
from lib import appsync
def lambda_handler(event, context):
print(event)
input = {
'name': 'test123',
'description': 'some cool description'
}
@simecek
simecek / datetimeindex.ipynb
Created April 30, 2020 21:39
DateTimeIndex.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@steveklabnik
steveklabnik / oil.md
Last active January 15, 2021 21:32
Why is the price of oil negative?

so, why is oil's price negative?

(note: I am a software developer who has an interest in finance. This is my understanding. I am not a professional.)

first, what does that even mean? so, the "price of oil" is the price of "WTI Crude", which is a specific kind of oil. There are multiple kinds of oil with multiple prices.

Why is it negative? to understand this, we also have to understand why WTI is the price of oil: that is, it's the kind of oil that underpins the New York Mercantile Exchange's oil futures contracts. The NYMEX is kind of like the stock market, but for commodities, aka stuff.