Skip to content

Instantly share code, notes, and snippets.

@danyx23
danyx23 / ask_gpt.ipynb
Created May 11, 2023 06:51
Simple jupyter notebook to use chat-gpt
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danyx23
danyx23 / owid-gpt-data-test.ipynb
Last active March 22, 2023 18:26
Test GPT for answering questions about a specific variable
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
flowchart LR
  classDef user fill:#aa6666aa;
  classDef siteArtifact fill:#66aa66aa;

  Admin --> Wordpress
  Wordpress --> GrapherMysql[Grapher Mysql]
  Admin --> GrapherMysql[Grapher Mysql]
  Importers --> GrapherMysql[Grapher Mysql]
  Wordpress --> WpMysql[WP Mysql]
@danyx23
danyx23 / 2021-07-20 check all grapher configs against json schema.ipynb
Created July 20, 2021 14:15
Jupyter notebook to validate all OWID grapher configs against a given JSON schema
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danyx23
danyx23 / 2021-07-08 investigate json config possible values.ipynb
Created July 20, 2021 14:11
Jupyter notebook for investigating grapher json configs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"openapi": "3.0.1",
"info": {
"title": "ToxPlanet Search Service",
"version": "3.0.0"
},
"servers": [
{
"url": "https://search-service.toxplanetdev.com",
"description": "Development server"
@danyx23
danyx23 / simpleMazeSolver.fs
Created October 2, 2019 15:46
Simple Maze Solver in F#
let labyrinthString = """xxxxxxx
x x
x x x x
x x x
x xxx x
x x
xxxxxxx"""
let labyrinth =
labyrinthString.Split("\n")
@danyx23
danyx23 / mazes.txt
Created October 2, 2019 15:43
Simple mazes for the friendly functional meetup
xxxxxxx
x x
x x
x
x x
x x
xxxxxxx
xxxxxxx
x x
@danyx23
danyx23 / Main.hs
Last active November 7, 2018 20:00
An exmple of a simple Haskell that has a small bug
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
-- This file will not compile - there is a small error you need to fix.
-- Follow the guidelines about how to set up a new stack project and copy
-- this file, then run stack build to try and compile.
-- To have the dependencies available you have to add this fragment to the package.yaml of
-- your stack project:
-- - aeson
@danyx23
danyx23 / pragmatic.hs
Last active September 7, 2018 15:54
Demonstrate use of typeclasses and simple monad transformer stacks to structure haskell apps
-- This is a small example for structuring Haskell programs so that
-- you neither have to 1) define half your program to live in IO or
-- 2) build complex Monad transformer stacks where you have to lift
-- several times to be able to do the correct operations.
-- Instead, this approach (shown to me by @am_i_tom at BusConf 2018)
-- uses type classes that define a set of operations and then define
-- a type `App a` that is a small Monad transformer stack of EitherT,
-- ReaderT and IO that implement these type classes. This allows
-- you to write functions that declare (via these type classes) which
-- capabilities they need to run. You can also easily write a different