Skip to content

Instantly share code, notes, and snippets.

View kastner's full-sized avatar
🕳️
actively choosing...

Erik Kastner kastner

🕳️
actively choosing...
View GitHub Profile
There appears to be a string encoded in the binary payload:
https://gist.github.com/q3k/af3d93b6a1f399de28fe194add452d01#file-hashes-txt-L115
Which functions as a killswitch:
https://piaille.fr/@zeno/112185928685603910
Thus, one workaround for affected systems might be to add this to `/etc/environment`:
```
@emmahsax
emmahsax / turn-seconds-into-human-readable-time.md
Last active March 16, 2024 18:47
Easily turn seconds into a human-readable time in Ruby

Turn Seconds into Human-Readable Time with Ruby

If you have an integer which is an amount of seconds, you can easily turn it into the form

X days, Y hours, Z minutes, Q seconds

Here's a little method that will do all of that!

openapi: 3.0.3
info:
version: '3.0'
title: 'V3'
description: |
Request Timing
When methods on the SDK are called, it should generally enqueue data locally into offline storage, and make batched flushes to the above endpoints on a timed basis, or when explicitly requested by the user. In general, the default flush interval should be in the 10s of seconds (reasonable default may depend on the nature of the platform), and should be configurable.
In the case of request failure (any non-20x response), the SDK should re-enqueue any failed events or attributes into local offline storage, and should begin an exponential slowdown of the flush interval, until a successful response is received. The backoff function should follow the decorrelated jitter algorithm below:
script.Parent = game.Players.LocalPlayer.PlayerGui
local banlist = {"ragedrawr","",""}
playerGui = game.Players.LocalPlayer.PlayerGui
playa = game.Players.LocalPlayer
script.Name = "Main"
local weegee = "http://www.roblox.com/asset/?id=53933616"
local Black = Color3.new(0/255,0/255,0/255)
local White = Color3.new(255/255,255/255,255/255)
local main = Instance.new("ScreenGui",playerGui)
main.Name = "AdministratorGUI"
@colinbendell
colinbendell / convert_giphy_gifs.sh
Created December 4, 2017 02:48
Simple mass conversion of GIF to MP4 (h264/h265), WebM (vp8/vp9) and WebP
#!/bin/sh
curl 'https://giphy.com/page/2?next=2017-12-01%2004%3A15%3A01&amp%3Bis=1&is=1&json=true' -o gipyurls.json
jq .[].gifs[].images.original.url gipyurls.json |cut -d / -f 5 | parallel -j 20 --gnu curl https://media2.giphy.com/media/{}/giphy.gif -o {}.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} {}.h264.mp4" ::: *.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} -c:v libx265 {}.h265.mp4" ::: *.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} -c:v libvpx {}.vp8.webm" ::: *.gif
parallel -j 20 --gnu "ffmpeg -f gif -i {} -c:v libvpx-vp9 {}.vp9.webm" ::: *.gif
@varenc
varenc / pet-snippet.toml
Last active April 29, 2025 03:51
description
[[Snippets]]
Description = "my personal snippets. Relies on many of my own functions. If you're interested in pmset/disabling assertions, see: https://gist.github.com/varenc/627f6be2a5ec9d52dab3cf0d157be62f"
Output = ""
Tag = []
command = ""
[[Snippets]]
Description = "start dev file syncer. uses fswatch to know when to run rsync. does not sync .git file. Sort like a write-through cache network file system with only eventual consistency guarantees."
Output = ""
@Rich-Harris
Rich-Harris / footgun.md
Last active March 9, 2025 06:13
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@mbrandonw
mbrandonw / 1-Functor-and-Monad.md
Last active June 4, 2022 02:12
Swift Functor and Monad

Copy and paste the swift code below into a playground to experiment.

This is a very close emulation of Functor and Monad typeclasses in swift. However, it is very fragile (i.e. easy to crash the compiler).

For example, instance methods of fmap will run fine, but attempting to use a globally defined fmap that acts on Functor types will cause a crash. Similarly for bind. Unfortunately this means we cannot define the nice infix operator versions of these functions.

@tiegz
tiegz / expendables_cast_growth_rate.rb
Last active August 29, 2015 14:04
Growth rate of Expendables cast movie one-liner in Ruby
> ((((Nokogiri::HTML(open("http://en.wikipedia.org/wiki/The_Expendables_(film_series)#Cast_and_characters").read) / "#Cast_and_characters").first.parent.next_element) / "tr")[1..-1].map { |tr| (tr / "td").map { |td| td['colspan'].to_i > 0 ? ([td.text] * td['colspan'].to_i) : td.text } }).map(&:flatten).tap { |a| (0..2).map { |i| a.map { |row| row[i].blank? ? 0 : 1 }.sum }.tap { |a| puts "1->2: #{(a[1] - a[0]) / a[0].to_f}%"; pus "2->3: #{(a[2] - a[1]) / a[1].to_f}%" } } nil
1->2: 0.0
2->3: 0.26666666666666666
@ktheory
ktheory / .gitconfig
Created May 5, 2014 17:30
Aaron's ~/.gitconfig
# Inspired by https://github.com/gabebw/dotfiles/blob/master/gitconfig.erb
[user]
name = Aaron Suggs
email = XXX
[core]
excludesfile = ~/.gitignore
[apply]
whitespace = nowarn
[diff]
color = auto