Skip to content

Instantly share code, notes, and snippets.

View wjzz's full-sized avatar
🍕
Working from home

Wojciech Jedynak wjzz

🍕
Working from home
View GitHub Profile
@xplat
xplat / agda-wishlist.txt
Created May 18, 2011 20:51
agda wishlist
= agda-mode
* C-c C-c should accept an expression and create a with. (does it do this already?) Or there should be another key combo to create a with.
* C-c C-c should work from inside complex expressions, not just when the RHS is a single hole. Variables know where they are bound, and the RHS can be duplicated and specialized.
* A key combo to rename a variable in scope. [should this include occurrences outside the current module? in general that would require an IDE-style project system ...]
* Undo without reload.
* Preview for agsy and null refine. [maybe redundant with the above]
* A key combo to suck the region into a hole.
* A key combo to expand a hole to the next higher node in the syntax tree.
! More consistent yellow highlighting during smart editing without reload.
@traviskaufman
traviskaufman / logback_disable_in_unit_tests.md
Last active March 20, 2023 08:38
Logback: Disable all logging in unit tests

After scouring the internet and piece-mealing together the correct way to do this, here is a step-by-step, all-in-one-place guide to making logback STFU when running your unit tests.

Here's how to do it

Save the following as logback-test.xml under src/test/resources:

<configuration>
  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
      <pattern>%msg%n</pattern>
@jherax
jherax / is-private-mode.js
Last active March 19, 2024 18:29
Detect if the browser is running in Private mode - Promise based (last update: Feb 2020)
/**
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise<boolean>}
*
* Live demo:
* @see https://output.jsbin.com/tazuwif
*
* This snippet uses Promises. If you want to run it in old browsers, polyfill it:
* @see https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js
*
@DarinM223
DarinM223 / typeclassses.md
Last active March 31, 2023 03:35
Typeclasses in Haskell, Scala, and Rust

Type classes

Type classes have some advantages over Java style interfaces. One advantage is the ability to implement functions that do not need to take in an instance of the interface.

For example, (FromString v) takes in a String and returns v, and it doesn't have to take v as a parameter.