Skip to content

Instantly share code, notes, and snippets.

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

Graham Duncan duncangh

💭
👨‍💻
View GitHub Profile
@ChristopherNickels
ChristopherNickels / backtesting.py
Last active May 6, 2022 05:31
DCF Model for 2015 Portfolio
"""
@authors: Lorenzo, Christopher
"""
from utils import read_income_statement, read_balance_sheet, read_cash_flow, companies
def fcff_forecast(comp):
last_year = 2014
income = read_income_statement(comp, 2009, 2014)
ebitp = read_income_statement(comp, 2009, 2014)
@ChristopherNickels
ChristopherNickels / main.py
Last active May 6, 2022 06:05
DCF Model for 2019 Portfolio
"""
@authors: Christopher, Lorenzo
"""
from utils import read_income_statement, read_balance_sheet, read_cash_flow, read_company_profile, companies
def fcff_forecast(comp):
last_year = 2019
income = read_income_statement(comp, 2014, 2019)
ebit = read_income_statement(comp, 2014, 2019)
@willkurt
willkurt / prob_logic.ipynb
Last active September 16, 2021 17:25
Implementing probability as logic using Python's data model methods
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@parente
parente / README.md
Last active October 1, 2023 23:42
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

@fire-eggs
fire-eggs / betterbookmarks.py
Last active December 11, 2025 05:52
Python 3 - takes the Chrome Bookmarks file, and creates a better "Export Bookmarks" HTML page.
# Massages a Chrome bookmarks file into an HTML file.
#
# Features:
# - Folders are ordered alphabetically
# - Bookmarks are ordered alphabetically (by description)
# - Bookmarks are shown first, followed by folders
# - Folders can be expanded or collapsed. Initially collapsed.
# - Folders are indented nicely
# - A button is provided to expand/collapse all folders
#
@dabeaz
dabeaz / aproducer.py
Created October 17, 2019 17:46
"Build Your Own Async" Workshop - PyCon India - October 14, 2019 - https://www.youtube.com/watch?v=Y4Gt3Xjd7G8
# aproducer.py
#
# Async Producer-consumer problem.
# Challenge: How to implement the same functionality, but no threads.
import time
from collections import deque
import heapq
class Scheduler:
@simonw
simonw / example-Locations.xml
Last active July 21, 2019 06:19
Convert Locations.kml (pulled from an iPhone backup) to SQLite
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<TimeStamp>
<when>2015-12-18T19:12:32</when>
</TimeStamp>
<name>2015-12-18 19:12:32 Source: WhatsApp</name>
<Point>
<coordinates>-0.120970480144024,51.510383605957</coordinates>
@sundowndev
sundowndev / GoogleDorking.md
Last active July 23, 2026 18:10
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@wkw37
wkw37 / Valuation.ipynb
Created June 2, 2019 20:03
Valuation models using multiples
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iwatake2222
iwatake2222 / detection_PC.py
Last active June 11, 2026 04:41
Object detection using MobileNet SSD with tensorflow lite (with and without Edge TPU)
# -*- coding: utf-8 -*-
import cv2
import tensorflow as tf
import numpy as np
# https://www.tensorflow.org/lite/guide/hosted_models
# http://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip
def detect_from_camera():