Skip to content

Instantly share code, notes, and snippets.

View runjak's full-sized avatar
🍧
<- drop it.

Jakob Runge runjak

🍧
<- drop it.
View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active July 24, 2024 14:23
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@0xabad1dea
0xabad1dea / newspaper.html
Last active November 10, 2023 15:54
cohost newspaper template
<div style="width:100%; font-family:serif;font-size:16px;text-align:justify;">
<div style="font-weight:900;text-align:center;font-size:48px;border-bottom:3px solid black;font-variant:small-caps;margin-bottom:0px;">
The Eggbug Times
</div>
<div style="font-style:italic; font-size:18px;text-align:center;">
the fourth website to ever exist
</div>
<div style="text-transform:uppercase;font-size:48px;text-align:center;">
from argparse import ArgumentParser
from time import sleep
try:
import twitter
except:
print('Requires python-twitter: pip install python-twitter')
exit(1)
api = twitter.Api(
consumer_key='...',
# Copyright 2020 Jannis Harder
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
@fhk
fhk / lp_solver_wasm.md
Last active May 16, 2024 18:28
Compiling a linked linear programming solver library

Linear Programming Solver running in the browser?

So I wanted to see if I could get a solver running in the browser.

Why you might ask? Well its pretty typical to need to deploy a back end for a webapp or even to have a specific install on your OS.

This makes things clunky if we wanted to say:

  1. Visualize solutions in realtime using some js libs on the client side
  2. Solve models on the client side of a web app
@gaearon
gaearon / uselayouteffect-ssr.md
Last active July 7, 2024 18:47
useLayoutEffect and server rendering

If you use server rendering, keep in mind that neither useLayoutEffect nor useEffect can run until the JavaScript is downloaded.

You might see a warning if you try to useLayoutEffect on the server. Here's two common ways to fix it.

Option 1: Convert to useEffect

If this effect isn't important for first render (i.e. if the UI still looks valid before it runs), then useEffect instead.

function MyComponent() {
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active July 21, 2024 05:06
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@adammockor
adammockor / fixed-memory-leak.js
Last active March 14, 2018 07:37
Memory leak test of require-uncached
const heapdump = require('heapdump');
const uncached = require('./require-uncached-patch.js');
let i;
for (i = 0; i < 100000; i++) {
require('./module.js')();
}
heapdump.writeSnapshot('./FixedMemoryLeakBefore-' + Date.now() + '.heapsnapshot');
@mgmeier
mgmeier / RingBuffer.hs
Created April 28, 2016 15:09
Ring buffer in Haskell
{-# LANGUAGE BangPatterns #-}
{-
Scenario / preconditions for the usefulness of this ring buffer:
- mutable data structure
- elements of the same size (here: ByteString, extending to values of class Storable should be trivial)
- each element is denoted by a continuous Int id
- main benefit, esp. for a large number of elements: