Skip to content

Instantly share code, notes, and snippets.

View fwenzel's full-sized avatar
😈

Fred Wenzel fwenzel

😈
View GitHub Profile
@fwenzel
fwenzel / rc4.js
Last active August 29, 2015 14:08 — forked from ttaubert/rc4.js
function*r(k){t=x=>(y=x%n)in s?s[y]:y;w=_=>t((s[i%n]=t(j+=f=t(i++)))+(s[j%n]=f));for(n=256,s=[i=j=0];i<n;)w(j+=k[i%k.length]);for(j=0,i=1;;)yield w()}
// A raw RC4 stream.
// Works in Firefox only (needs lots of ES6).
// 150 chars
// Usage:
for (var b of r([65,65,65])) {
console.log(b);
}
@fwenzel
fwenzel / gist:4cc97d8976821e8d9e4b
Created November 4, 2014 20:08
pyobjc 2.4 install error
running install_lib
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/fred/.virtualenvs/upshot/build/pyobjc-core/setup.py", line 492, in <module>
zip_safe = False,
@fwenzel
fwenzel / irccloud-darkmatter.userstyle.css
Last active October 8, 2015 19:31
A dark user style for irccloud, based on "Dark Matter", tweaked for irccloud.mozilla.com
@-moz-document domain("irccloud.com"), domain("irccloud.mozilla.com") {
/* Dark Matter Reloaded
* Version 2.3 - 03/02/2015
*
* Author: @xupisco - xupisco.net */
/* Square corners, pls */
* {
border-radius: 0 !important;
border-top-right-radius: 0 !important;
@fwenzel
fwenzel / gist:5259ec6ec8b98d90cab1
Created May 13, 2015 20:01
Comparison of Mozilla product details regions and US GENC standard.
--- existing.json 2015-05-13 12:59:19.000000000 -0700
+++ genc.json 2015-05-13 12:54:02.000000000 -0700
@@ -1,12 +1,11 @@
{
"ad": "Andorra",
- "ae": "U.A.E.",
+ "ae": "United Arab Emirates",
"af": "Afghanistan",
"ag": "Antigua and Barbuda",
"ai": "Anguilla",
@fwenzel
fwenzel / gist:8848aebe89e349367719
Created May 13, 2015 20:37
Comparison of Mozilla product details regions and ISO 3166.
--- existing.json 2015-05-13 12:59:19.000000000 -0700
+++ slim.json 2015-05-13 13:35:50.000000000 -0700
@@ -1,12 +1,11 @@
{
"ad": "Andorra",
- "ae": "U.A.E.",
+ "ae": "United Arab Emirates",
"af": "Afghanistan",
"ag": "Antigua and Barbuda",
"ai": "Anguilla",
#!/usr/bin/env python
import json
import re
from xml.etree import ElementTree as ET
NS = {'genc': 'http://api.nsgreg.nga.mil/schema/genc/2.0'}
ent = lambda name, ns: '{%s}%s' % (NS[ns], name)
tree = ET.parse('genc.xml')
@fwenzel
fwenzel / b2.md
Last active July 31, 2023 04:40
Mastodon --> Backblaze B2

Using Mastodon with Backblaze B2

Mastodon can store its assets in Amazon S3 (it speaks the S3 protocol). But it does not, by default, speak to Backblaze B2.

There are a couple of reasons why you might want that:

  • you already know and trust B2
  • it's cheaper
  • you do not want to make your instance dependent on AWS
  • etc.