Skip to content

Instantly share code, notes, and snippets.

View tdhopper's full-sized avatar
©️
𝔀𝓸𝓻𝓴𝓲𝓷𝓰 𝓱𝓪𝓻𝓭

Tim Hopper tdhopper

©️
𝔀𝓸𝓻𝓴𝓲𝓷𝓰 𝓱𝓪𝓻𝓭
View GitHub Profile
@tdhopper
tdhopper / custom instructions.md
Created January 29, 2024 19:44
My current ChatGPT custom instructions
  • Call me "Tim"
  • Be terse. No yapping.
  • Suggest solutions I didn't think about—anticipate my needs
  • Treat me as an expert
  • Be accurate and thorough
  • Code first, then detailed explanation; restate query if needed
  • No moral lectures
  • Discuss safety only when crucial and non-obvious
  • Cite sources at the end, not inline
  • Omit knowledge cutoff and AI status
@tdhopper
tdhopper / dataframe to kml
Created March 26, 2013 18:21
Pandas dataframe to KML in 4 lines
import simplekml
kml = simplekml.Kml()
df.apply(lambda X: kml.newpoint(name=X["name"], coords=[( X["longitude"],X["latitude"])]) ,axis=1)
kml.save(path = "data.kml")
@tdhopper
tdhopper / .editorconfig
Last active July 21, 2022 12:52
Configuration files to enable validating python code with flake8, mypy, isort, and black using pre-commit hooks (via https://pre-commit.com/). Also an .editorconfig file for standardization across editors.
# http://editorconfig.org/#file-format-details
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
from scipy.stats import dirichlet, poisson
from numpy.random import choice
num_documents = 5
num_topics = 2
topic_dirichlet_parameter = 1 # beta
term_dirichlet_parameter = 1 # alpha
vocabulary = ["see", "spot", "run"]
num_terms = len(vocabulary)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
data/
.env/
__pycache__
.ipynb_checkpoints
gistup
gistup
gistup
@tdhopper
tdhopper / weather.sh
Last active April 4, 2020 03:50
Get weather for Morrisville, NC
curl http://api.openweathermap.org/data/2.5/weather?q=27560 | /usr/local/bin/jq .main.temp | awk '{print $1 * 9.0 / 5 - 459.67}' OFMT="NC:%2.0f°"