Skip to content

Instantly share code, notes, and snippets.

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

Graham Duncan duncangh

💭
👨‍💻
View GitHub Profile
import asyncio
class AsyncConstructorMeta(type):
"""Metaclass to support asynchronous constructors in Python.
Basically we're exploiting the fact that __new__ can return anything in Python.
So we're taking the old __init__ code, removing it from the class, and instead,
we create a custom __new__ method that returns a coroutine wrapping the original
constructor.
@simecek
simecek / styleformer-demo.ipynb
Created August 6, 2021 17:02
Styleformer demo.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 25, 2025 10:00
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

drop table if exists shipments;
create table shipments (
id serial primary key not null,
sender_address_id integer not null,
sender_contact_id integer not null,
receiver_address_id integer not null,
receiver_contact_id integer not null,
created_at timestamp not null default current_timestamp,
units integer not null,
zar_value numeric not null
<?
//
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio)
//
// File: twitterFollowerCuratorBot.php
//
// Created: May 2021
// License: MIT
//
@stephszeto
stephszeto / valuation-output-industry.txt
Created March 15, 2021 07:25
valuation.py output (single ticker with industry enabled)
>> python3 valuation.py -t enph -i
Fetching industries data ...
Processing ENPH
Solar (US): ['ENPH', 'RUN', 'FSLR', 'SPWR', 'SHLS', 'VSLR', 'NOVA', 'BEEM', 'SUNW', 'PECK', 'EVSI']
Fetching data for ENPH
Starting DCF calculation for ENPH
Equity %: 94%
Cost / equity = riskfree rate + beta * country ERP
Cost / equity = 2% + 1.13349 * 0.09
@dopplershift
dopplershift / RTMA+Sat+Sfc.ipynb
Created February 12, 2021 03:00
Example notebook plotting satellite data, RTMA data, and surface observations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 June 27, 2024 04:09
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.