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 May 2, 2024 22:56
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"
command = ""
output = ""
[[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."
command = "fswatch -0 --exclude \"\\.git\" --exclude \"\\.xml\" --exclude \"___\" -o /Users/chris/Documents/workspace/lingt_chris_dev_rsync_checkout/myproject | xargs -0 -n 1 -I {} rsync --progress --exclude '*.pyc' --exclude '*.git' --recursive ~/workspace/lingt_chris_dev_rsync_checkout/myproject dev@dev.server:/home/user/webapps/dev_chris/myproject"
output = ""
@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
@grantslatton
grantslatton / hngen.py
Last active September 27, 2021 11:07
A program that uses Markov chains to generate probabilistic Hacker News titles.
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"