Skip to content

Instantly share code, notes, and snippets.

@quchen
quchen / trolling_haskell
Last active November 12, 2024 00:10
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@mtesseract
mtesseract / haskell-records.md
Last active March 8, 2023 22:25
Working around Haskell's namespace problem for records

The Problem

Defining records in Haskell causes accessor functions for the record's fields to be defined. There is no seperate namespace for these accessor functions.

The Goal

Be able to

  • use records in Haskell, which share field names.
  • use lenses for accessing these fields
@alpmestan
alpmestan / redirect.hs
Created October 17, 2017 12:10
servant redirects, new generation
{-
$ curl -X POST localhost:9876/dog -v
* Connected to localhost (127.0.0.1) port 9876 (#0)
> POST /dog HTTP/1.1
> Host: localhost:9876
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Transfer-Encoding: chunked
@IanColdwater
IanColdwater / twittermute.txt
Last active November 17, 2024 02:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet

Guix on WSL2

(updated versions of this document, plus more, live here)

This will show you how to get Guix running on WSL2.
We're going to go as "minimal" as possible, without starting off one of the readily available WSL2 distros.
Parts of this guide should help with understanding how to set up any custom distro on WSL, not just Guix.

Disclaimer: I'm a Guix nOOb! (hence going through the trouble of installing it on WSL2)

@jb3
jb3 / README.md
Last active September 25, 2024 14:34
A simple implementation of Discord Slash Commands in Python with Microsoft Function Apps.

Dice rolling — Discord Interaction Edition

This is a very basic Discord Interaction designed to run on Azure Function Apps using the Python runtime.

Steps to get running

  1. Head to Discord and create a new application, take note of the Client ID, Client Secret and Interactions Public Key.
  2. Create a new Azure function app with the code in azure_function.py, make sure to add an app setting called INTERACTION_PUBLIC_KEY with the value taken from Discord. Make sure to add discord_interactions to your requirements.txt file, the function depends on it!
  3. Place the URL of your App Function HTTP trigger into the Discord Developer portal. If things are working it will allow you to save.
  4. Add the application to your server by visiting the OAuth2 URL generator in the Developer portal and creating a link with the application.commands scope.
@debasishg
debasishg / cache-oblivious.md
Last active September 2, 2024 07:20
Papers related to cache oblivious data structures

Cache Oblivious and Cache Aware Data Structure and Algorithms

  1. Cache-Oblivious Algorithms and Data Structures - Erik Demaine (One of the earliest papers in cache oblivious data structures and algorithms that introduces the cache oblivious model in detail and examines static and dynamic cache oblivious data structures built between 2000-2003)

  2. Cache Oblivious B-Trees - Bender, Demaine, Farch-Colton (This paper presents two dynamic search trees attaining near-optimal performance on any hierarchical memory. One of the fundamental papers in the field where both search trees discussed match the optimal search bound of Θ(1+log (B+1)N) memory transfers)

  3. Cache Oblivious Search Trees via Binary Trees of Small Height - Brodal, Fagerberg, Jacob (The data structure discussed in this paper works on the version of [2] but avoids the use o