Skip to content

Instantly share code, notes, and snippets.

View jryans's full-sized avatar

J. Ryan Stinnett jryans

View GitHub Profile
@jackfirth
jackfirth / continuation-lessons.md
Last active August 9, 2024 02:59
Examples of how to build control flow structures with continuations

Lessons in Using Continuations

This gist contains examples of how to build different kinds of control flow structures in Racket using macros and continuations. Examples include:

  • Early exit from functions using a return statement.
  • Early exit from arbitrary expressions using a simple exception system.
  • Temporarily interrupting execution in order to check permissions.

TL;DR: what was the bug? (spoilers!): https://gist.github.com/trptcolin/6039cd454acfe6e820d13cbdce5e4064

#!/bin/bash
# Init.
if [ "$1" == "--silent-fail" ]; then
SILENT_FAIL=true
else
SILENT_FAIL=false
fi
ACCESS_TOKEN="[REDACTED]"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@codehag
codehag / try-failures-bookmarklet.js
Last active March 6, 2018 17:06
try test failure bookmarklet
//add this to a bookmark link field, and use it to collect try failures from a domain such as
// https://treeherder.mozilla.org/testview.html?repo=try&revision=a1372c8e3c8a4c3ecbda2ff84f7ea306fb95c1d7
// it will output the collected tests into the console!
javascript:%20(function()%20{%20var%20testNodes%20=%20document.querySelectorAll(".test");%20var%20failingTests%20=%20"";%20for%20(let%20testNode%20of%20testNodes)%20{%20%20%20failingTests%20+=%20testNode.textContent.trim()%20+"%20";%20}%20console.log(failingTests.trim())})()
@evancz
evancz / data-interchange.md
Last active December 27, 2025 05:40
Why do I have to write JSON decoders in Elm?

A vision for data interchange in Elm

How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?

These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.

Literature Review

By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.

@solso
solso / human-web-overview.md
Last active December 6, 2019 12:36
Human Web Overview

Human Web Overview

Konark Modi, Alex Catarineu, Philipp Claßen and Josep M. Pujol at Cliqz *München, October 2016

[edited on October 2017]*

[edited on September 2019 to fix broken links and add reference to HPN paper]*

We recommend to read the article on Cliqz Tech blog, the content is more up to date there. Not removing this gist for historical reasons. December 2019.

@mbrubeck
mbrubeck / parallel-layout.md
Created September 22, 2017 23:48
Parallel layout in Gecko

Parallel Layout in Gecko

Now that Gecko uses Servo's parallel style system, we want to work outward from there. The next phase could be parallel frame construction, and after that, parallel layout using Servo layout code.

Dividing work between Gecko and Servo

We want to ship this work incrementally (every six weeks), without needing to replace the entire layout system at once. There are a few ways we can convert

@LukasKalbertodt
LukasKalbertodt / 0-rust-wasm-llvm-backend.md
Last active September 22, 2020 12:18
Several Rust & WebAssembly notes

Compiling Rust to Wasm manually with the LLVM wasm-backend (without Emscripten)

EDIT November 2017: recently the target wasm32-unknown-unknown was added to rustc which uses the LLVM WASM backend and works without Emscripten. This is now the recommended way of generating WASM code from Rust (as it is much easier). Thus, this gist document is pretty much useless now. A great resource on getting started with WASM and Rust is hellorust.com: Setup and Minimal Example.