Skip to content

Instantly share code, notes, and snippets.

View anderl80's full-sized avatar
🐝
Busy Bee

Andreas Hopfgartner anderl80

🐝
Busy Bee
View GitHub Profile
@csiebler
csiebler / openai_prompts.md
Last active November 23, 2023 14:28
Azure OpenAI Service prompt examples

GPT-3 examples (using mostly text-davinci-003)

Information extraction from claim phone conversations

  • Engine: text-davinci-003 (also works in text-davinci-002, but might require more instructions to get a correct JSON back)
  • Temperature: 0.7
You must extract the following information from the phone conversation below:
import geocoder
import csv
import sys
import time
import json
input_csv = sys.argv[1]
out_provider = sys.argv[2]
out = open("output/output_"+out_provider+"_"+input_csv.strip('.csv')+"_"+str(time.strftime("%s", time.gmtime()))+".geojson","w")
output_geojson = {"type": "FeatureCollection","features": []}
with open(input_csv) as input_file:
@sjpfenninger
sjpfenninger / pypsa_plotly.py
Last active April 12, 2019 13:16 — forked from nworbmot/pypsa_plotly.py
Minimal example of plotly working with PyPSA - using Mapbox
mapbox_access_token = 'PASTE_YOUR_TOKEN_HERE'
import plotly.offline as py
from plotly.graph_objs import *
import plotly.graph_objs as go
import pypsa
py.init_notebook_mode(connected=True)
%matplotlib inline
@wassname
wassname / live_plot_notebook.py
Created September 27, 2017 06:14
Live plot using %matplotlib notebook in jupyter notebook
import numpy as np
from matplotlib import pyplot as plt
class LivePlotNotebook(object):
"""
Live plot using %matplotlib notebook in jupyter notebook
Usage:
```
import time
@smartnose
smartnose / spark-internals-through-code.md
Last active March 20, 2024 21:23
Spark internal notes

Spark internals through code

Nothing gives you more detail about spark internals than actually reading it source code. In addition, you get to learn many design techniques and improve your scala coding skills. These are the random notes I make while reading the spark code. The best way to comprehend the notes is to load spark code into an IDE, e.g. IntelliJ, and navigate the code on the side.

Genesis - creation of a spark cluster

The scripts for creating a spark cluster are: start-master.sh and start-slave.sh. Read them carefully, and you can see that both scripts are very similar except the values for $CLASS variable. For start-master.sh, the value is CLASS="org.apache.spark.deploy.master.Master", while the value for start-slave.sh is shown below with more context.

# NOTE: This exact class name is matched downstream by SparkSubmit.
import {Sql} from "../providers/Sql";
export class ExamplePage {
constructor(private sql: Sql) {
//sql.query(...);
//...
}
}
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 28, 2024 15:27
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\