Skip to content

Instantly share code, notes, and snippets.

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

Fiona runjak

🍧
<- drop it.
View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active December 25, 2025 23:58
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.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@karpadiem
karpadiem / mosyle_license_audit.py
Last active November 18, 2024 12:54
This script is used to audit Mosyle MDM's user and devices license. It queries their API for devices and calculates the amount of licenses an account should be charged for. Using this we found that we were being billed for an extra User Enrollment license for a device and user that no longer showed in our dashboard.
# Author: Jake Garrison
# Date: 2023-03-29
# Description: This script fetches devices from the Mosyle API and processes it to help us in creating our managment fee reports. It can also be used to audit Mosyle licenses to compaire with current billing.
# This script requires the Mosyle API token, Mosyle API URL, Mosyle API User, and Mosyle API Password to be set. It also requires the tabulate module to be installed. You can install it with pip install tabulate (or pip3 install tabulate)
# THis is a simplified version of our script primarly aimed at helping other companies perform a license audit.
import base64
import requests
import json
from sys import exit
@0xabad1dea
0xabad1dea / newspaper.html
Last active November 2, 2024 08:33
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 November 26, 2025 07:31
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 December 26, 2025 14:47
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');