Skip to content

Instantly share code, notes, and snippets.

double_it : IO ()
double_it = do
input <- getLine
let n = the Int (cast input)
printLn (n * 2)
Idris> :t [1 .. 10]
enumFromTo 1 10 : List Integer
Idris> :t [1 ..]
enumFrom 1 : Stream Integer
for x in range(12):
jgarte /
Created January 9, 2024 05:11 — forked from simeonf/
Creating a PEX from a python script

So you want to create a pex that packages your script and its dependencies?

Ok - first to make our script! Call it

import requests

if __name__ == '__main__':
  req = requests.get("")
  print req.text.split("\n")[0]
jgarte /
Created November 27, 2023 04:10 — forked from MassD/
A implementation for generating all permutations of a list, written in OCaml
(* note that in order to preserve certain order
and also show the conciseness of the implementation,
no tail-recursive is used *)
let ins_all_positions x l =
let rec aux prev acc = function
| [] -> (prev @ [x]) :: acc |> List.rev
| hd::tl as l -> aux (prev @ [hd]) ((prev @ [x] @ l) :: acc) tl
aux [] [] l
jgarte / eglot-rust-analyzer.el
Created May 5, 2023 06:43 — forked from casouri/eglot-rust-analyzer.el
Configuring eglot for rust-analyzer
;; How to translate LSP configuration examples into Eglot’s format:
;; Usually LSP servers will say something like
;; rust-analyzer.procMacro.attributes.enable (default: true)
;; Translate that into a JSON LSP configuration, you get
;; {
;; "rust-analyzer": {
jgarte / chatgpt.el
Created January 22, 2023 01:52 — forked from Gavinok/chatgpt.el
chatgpt client for emacs WIP (Now Async!)
;;; chatgpt.el --- Simple ChatGPT frontend for Emacs -*- lexical-binding: t -*-
;; Copyright (C) Gavin Jaeger-Freeborn
;; This package is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This package is distributed in the hope that it will be useful,
jgarte / AOC-d1.el
Created December 21, 2022 05:32 — forked from Gavinok/AOC-d1.el
Emacs lisp solution for day one of advent of code 2022
(defun cals-per-elf ()
(progn (insert "((")
(insert-file-contents "~/res.txt")
(while (re-search-forward "^$" nil t)
(replace-match ")(" nil nil))
(end-of-buffer)(insert "))")
(goto-char 0))
(mapcar (lambda (food-carried)
(cl-reduce #'+ food-carried))
{ pkgs }:
lib = pkgs.lib;
# list of additional packages to add to the packageset
# source path of the package (derivation or (filtered) nix path)
assert (lib.all (pkg: pkg ? src) additionalPackages);
# dhall file of that package
jgarte /
Created October 25, 2022 02:07 — forked from rtt/
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> (horribly quick and dirty, you've been warned!)