Skip to content

Instantly share code, notes, and snippets.

View atextor's full-sized avatar

Andreas Textor atextor

View GitHub Profile
@bodil
bodil / init.ts
Created August 12, 2019 17:34
Snapshot of my vscode-use-package setup
import * as vscode from "vscode";
import { initUsePackage, usePackage, configSet } from "vscode-use-package";
import * as nav from "./nav";
import * as js from "./js";
import * as rust from "./rust";
export function init(context: vscode.ExtensionContext) {
console.log(`HELLO FROM INIT SCRIPT`);
@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
@saitoha
saitoha / rxvt-unicode-sixel.patch
Last active May 2, 2019 10:17
Add SIXEL graphics support for rxvt-unicode.
diff --git a/src/Makefile.in b/src/Makefile.in
index 18acb39e..ef2e7a40 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -40,7 +40,7 @@ COMMON = \
screen.o scrollbar.o scrollbar-next.o scrollbar-rxvt.o \
scrollbar-xterm.o scrollbar-plain.o xdefaults.o encoding.o \
rxvttoolkit.o rxvtutil.o keyboard.o rxvtimg.o \
- ev_cpp.o fdpass_wrapper.o ptytty_wrapper.o @PERL_O@
+ ev_cpp.o fdpass_wrapper.o ptytty_wrapper.o sixel.o @PERL_O@
@mrkgnao
mrkgnao / IosevkaConfigGen.hs
Last active November 8, 2022 18:28
Render Iosevka ligatures to Private Use Area glyphs, for Emacs
{-# LANGUAGE RecordWildCards, Arrows #-}
import Numeric
import Data.Char
import Control.Monad
import Data.Monoid ((<>))
import Data.List (nub, sort, reverse)
data RepeatBounds = RB

Getting Started in Scala

This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere…  I hope to present the information you need without assuming anything.

Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!

One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.

Getting the JVM

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@jboner
jboner / latency.txt
Last active May 3, 2024 15:17
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD