Skip to content

Instantly share code, notes, and snippets.

Avatar
😈

Fred Wenzel fwenzel

😈
View GitHub Profile
@fwenzel
fwenzel / b2.md
Last active Jan 13, 2021
Mastodon --> Backblaze B2
View b2.md

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.
View genc.py
#!/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 / gist:8848aebe89e349367719
Created May 13, 2015
Comparison of Mozilla product details regions and ISO 3166.
View gist:8848aebe89e349367719
--- 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",
@fwenzel
fwenzel / gist:5259ec6ec8b98d90cab1
Created May 13, 2015
Comparison of Mozilla product details regions and US GENC standard.
View gist:5259ec6ec8b98d90cab1
--- 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 / irccloud-darkmatter.userstyle.css
Last active Oct 8, 2015
A dark user style for irccloud, based on "Dark Matter", tweaked for irccloud.mozilla.com
View irccloud-darkmatter.userstyle.css
@-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;
View gist:4cc97d8976821e8d9e4b
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,
View 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);
}
View gist:06af765dd3e3ff6dfa47
https://twitter.com/kathleenbot/status/483625820645519361/photo/1
"Easily the best NYT News Alert I've ever gotten"
Picture says: "Supreme Court Ruling in Contraception Case", then underneath:
"The Supreme Court has ruled on whether for-profit corporations may advance claims based on religious freedom."
Then highlighted: "Our reporters are reading the decision and will update this article as soon as they feel confident about its basic meaning."
View gist:36b655c8f87cf9a7715f
130 fred@athena ~ % curl http://speedtest.newark.linode.com/100MB-newark.bin > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
85 100M 85 85.4M 0 0 2433k 0 0:00:42 0:00:35 0:00:07 2380k^C
130 fred@athena ~ % curl http://speedtest.atlanta.linode.com/100MB-atlanta.bin > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
61 100M 61 61.6M 0 0 2396k 0 0:00:42 0:00:26 0:00:16 2258k^C
130 fred@athena ~ % ping speedtest.newark.linode.com
PING speedtest.newark.linode.com (50.116.57.237): 56 data bytes
@fwenzel
fwenzel / cordovasample-demo.sh
Created Mar 11, 2014
Demo script for cordovasample
View cordovasample-demo.sh
#!/bin/sh
## Script to build Cordova Sample app, as described in this blog post:
# https://hacks.mozilla.org/2014/02/building-cordova-apps-for-firefox-os/
# Note, this assumes you have Cordova installed.
# More info: http://cordova.apache.org/
rm -rf cordovasample