Skip to content

Instantly share code, notes, and snippets.

View tosh's full-sized avatar
💭
🍄🌈

Thomas Schranz tosh

💭
🍄🌈
View GitHub Profile
what k4/k7 k9 example result
---------------------------------------------------------------------------------
each-left a f\:b a f\:b (!3)*\:!2 (0 0;0 1;0 2)
each-right a f/:b a f/:b (!3)*/:!2 (0 0 0;0 1 2)
fold f/v f/v */6 7 42
fold w/initial a f/v a f/v 7*/11 13 1001
scan f\v f\v -\1 1 1 1 0 -1
scan w/initial a f\v a f\v 3-\1 1 1 2 1 0
@paul356
paul356 / clojure-ctags.md
Last active November 7, 2022 14:35
Add Clojure support to exuberant ctags and vim-tagbar

ctags

Add the following to ~/.ctags (thanks, xzj / clojure.ctags):

--langdef=Clojure
--langmap=Clojure:.clj
--langmap=Clojure:+.cljs
--langmap=Clojure:+.cljx
--regex-clojure=/\([ \t]*create-ns[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/n,namespace/
--regex-clojure=/\([ \t]*def[ \t]+([-[:alnum:]*+!_:\/.?]+)/\1/d,definition/
@jeeger
jeeger / bookstats.clj
Last active November 26, 2022 15:37
Sum up page counts of books from Calibre library with babashka
#!/usr/bin/env bb
(ns bookstats
(:require [babashka.pods :as pods]
[clojure.pprint :as pprint]))
(pods/load-pod 'org.babashka/go-sqlite3 "0.1.0")
(pods/load-pod 'retrogradeorbit/bootleg "0.1.9")
(require '[pod.babashka.go-sqlite3 :as sqlite]
'[pod.retrogradeorbit.hickory.select :as s]
'[pod.retrogradeorbit.bootleg.utils :as utils])
(import [java.net URLEncoder]
@mikeananev
mikeananev / deps.edn
Created February 17, 2019 22:28
ED25519 Clojure Example
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
org.bouncycastle/bcprov-jdk15on {:mvn/version "1.61"}}}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shawwn
shawwn / What happens when you allocate a JAX tensor on a TPU.md
Last active April 15, 2023 04:11
JAX C++ stack trace walkthrough for TpuExecutor_Allocate
@stuartsierra
stuartsierra / lein2-issue.md
Created July 6, 2012 21:04
'file:' repositories in Leiningen 2.0.0-preview5 and later

Sample Project

Starting from:

lein new foo
cd foo

Say I have a random JAR file that is not available in any repository:

touch README.md

@swannodette
swannodette / inference.md
Last active August 7, 2023 16:13
Externs Inference

Externs Inference

Integrating third party JavaScript libraries not written with Google Closure Compiler in mind continues to both be a source of error for users when going to production, and significant vigilance and effort for the the broader community (CLJSJS libraries must provide up-to-date and accurate externs).

In truth writing externs is far simpler than most users imagine. You only need externs for the parts of the library you actually intend to use from ClojureScript. However this isn't so easy to determine from Closure's own documentation. Still in the process of writing your code it's easy to miss a case. In production you will see the much dreaded error that some mangled name does not exist. Fortunately it's possible to enable some compiler flags :pretty-print true :pseudo-names true to generate an advanced build with human readable names. However debugging missing externs means compiling your production build for each missed case. So much time wasted for such simple mistakes damages our sen

@Gaelan
Gaelan / README.md
Last active August 29, 2023 04:13
ChatGPT passes the 2022 APCSA free response section

ChatGPT passes the 2022 AP Computer Science A free response section

For fun, I had ChatGPT take the free response section of the 2022 AP Computer Science A exam. (The exam also has a multiple-choice section, but the College Board doesn't publish this.) It scored 32/36.

Methodology

  • For each question, I pasted in the full text of the question and took the response given.
  • I tried each question once and took the response given: no cherry-picking. For readability, I've added indentation in some cases, and included method signatures where they were provided in the question and ChatGPT only provided a body. I've added question numbers; any other comments are ChatGPT's.
  • Many questions have examples containing tables or diagrams; because those don't translate well to plain text, I excluded those tables/diagrams and any text that referenced them.
  • I excluded the initial instructions at the top of th
<?
//
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio)
//
// File: twitterFollowerCuratorBot.php
//
// Created: May 2021
// License: MIT
//