Skip to content

Instantly share code, notes, and snippets.

View jolars's full-sized avatar

Johan Larsson jolars

View GitHub Profile
@jolars
jolars / gpt-prompts.csv
Last active August 31, 2025 15:53
ChatGPT prompts
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
"act","prompt"
"Anki Card Maker","I want you to act as a flashcard creator, creating flashcards with a back side and a front side based on text that I provide. Use the SuperMemo principles for creating flashcards. Create questions that have clear and unambiguous answers and must be self-contained. The following is an example piece of text: ""The characteristics of the Dead Sea: Salt lake located on the border between Israel and Jordan. Its shoreline is the lowest point on the Earth's surface, averaging 396 m below sea level. It is 74 km long. It is seven times as salty (30% by volume) as the ocean. Its density keeps swimmers afloat. Only simple organisms can live in its saline waters."" Here are some good examples of flashcards for this text: Q: Where is the Dead Sea located?
A: on the border between Israel and Jordan., Q: What is the lowest point on the Earth's surface?
A: The Dead Sea shoreline, Q: What is the average level on which the Dead Sea is located?
A: 400 meters (below sea level), Q: How long is th
@jolars
jolars / keybase.md
Created December 3, 2018 19:00
keybase.md

Keybase proof

I hereby claim:

  • I am jolars on github.
  • I am johanlarsson (https://keybase.io/johanlarsson) on keybase.
  • I have a public key ASCgxa5S7cXsSbHjkhpQcODO7f3na3YC4go_-yAdBoQkwgo

To claim this, I am signing this object:

@jolars
jolars / beamer-template
Created October 15, 2018 08:45
A template for beamer presentations
\documentclass[serif]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[lining]{libertine}
\usepackage{textcomp}
\usepackage[varqu,varl,scaled=0.93]{inconsolata}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage[libertine,vvarbb,libaltvw,liby]{newtxmath}
@jolars
jolars / template-handout.Rnw
Last active December 10, 2017 12:20
Sweave (knitr) handout template
%\VignetteIndexEntry{}
%\VignetteEngine{knitr::knitr}
\PassOptionsToPackage{usenames,fixpdftex,dvipsnames,svgnames,x11names}{xcolor}
\PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{font=small,labelfont=bf,labelsep=period}{caption}
\documentclass[
oneside,
numbers=noendperiod,
@jolars
jolars / template-book.Rnw
Last active December 10, 2017 12:21
Sweave (knitr) book template
%\VignetteIndexEntry{eulerr under the hood}
\PassOptionsToPackage{usenames,fixpdftex,dvipsnames,svgnames,x11names}{xcolor}
\PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{font=small,labelfont=bf,labelsep=period}{caption}
\documentclass[
oneside,
openany,
numbers=noendperiod,
@jolars
jolars / vglmTrain.R
Last active March 15, 2016 14:46
Custom model fitting function for training vglm models with caret in R.
vglmTrain <- list(
label = "Vector Generalized Linear and Additive Models",
library = "VGAM",
loop = NULL,
type = "Classification",
parameters = data.frame(parameter = "parameter",
class = "character",
label = "parameter"),
grid = function(x, y,
len = NULL, search = "grid") data.frame(parameter = "none"),
@jolars
jolars / clmTrain.R
Last active March 14, 2016 19:41
Function for training clm models from ordinal with caret. Currently can't be passed any tuning parameters, and fits the proportional odds model.
clmTrain <- list(
label = "Cumulative Link Models",
library = "ordinal",
loop = NULL,
type = "Classification",
parameters = data.frame(parameter = "parameter",
class = "character",
label = "parameter"),
grid = function(x, y,
len = NULL, search = "grid") data.frame(parameter = "none"),