Skip to content

Instantly share code, notes, and snippets.

View fwenzel's full-sized avatar
😈

Fred Wenzel fwenzel

😈
View GitHub Profile
@fwenzel
fwenzel / cordova.js
Created February 19, 2014 17:57
An example cordova.js file, line 1112 might (but won't) violate CSP
// Platform: firefoxos
// 3.3.0
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@fwenzel
fwenzel / cordovasample.sh
Created March 11, 2014 19:19
Script to clone and build Cordova Sample app
#!/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/
cordova create cordovasample
cd cordovasample
@fwenzel
fwenzel / cordovasample-demo.sh
Created March 11, 2014 19:33
Demo script for cordovasample
#!/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
@fwenzel
fwenzel / gist:36b655c8f87cf9a7715f
Last active August 29, 2015 14:01
Linode speedtest
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
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."
@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 / 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')