Skip to content

Instantly share code, notes, and snippets.

You need a passphrase to unlock the secret key for
user: "Daniel Brooks <[email protected]>"
4096-bit RSA key, ID 10D29518, created 2016-12-15 (main key ID B03FB453)
gpg: encrypted with 4096-bit RSA key, ID 10D29518, created 2016-12-15
"Daniel Brooks <[email protected]>"
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
@db48x
db48x / add-shardmeta-branch.sh
Last active December 18, 2016 19:42
work-in-progress script for updating an iabak shard
#!/bin/bash
# Usage:
# ./add-shardmeta-branch.sh [OPTION] <shard> <collection> [<collection> ...]
# <shard> is the name of a new shard to create
# <collection> is the name of any collection of items on IA
#
# This script updates an existing shard so that it has a
# shardmeta branch with a get_all_items.sh script.
set -e
@db48x
db48x / test.sh
Last active November 19, 2016 21:06
#/bin/bash -x
GIT=git
pow () {
local x=${1:-1} y=${2:-0} result=${3:-1}
if [ ${y} -gt 0 ]; then
echo "$(pow "${x}" "$((y-1))" "$((result*x))")"
else
echo "${result}"
# Assign identifier and collection to variables for use in final output.
.metadata.identifier as $i |
.metadata.collection as $c |
# Filter out any items that do not have files metadata.
select(.files != null) |
# Get all non-derivative files that have a file size, and slim down the metadata.
.files |
map(
@db48x
db48x / example.js
Last active July 29, 2016 02:58
amiga example
var emulator = new Emulator(document.querySelector("#canvas"),
null,
new AMIGALoader(AMIGALoader.model("A2000"),
AMIGALoader.fastMemory(2),
AMIGALoader.nativeResolution(720, 568),
AMIGALoader.emulatorJS("emulators/amiga/amiga.js"),
AMIGALoader.mountFile("Kickstart v3.1 r40.63 (1993)(Commodore)(A500-A600-A2000)[!].rom",
AMIGALoader.fetchFile("Bios",
"examples/Kickstart v3.1 r40.63 (1993)(Commodore)(A500-A600-A2000)[!].rom")),
AMIGALoader.rom("Kickstart v3.1 r40.63 (1993)(Commodore)(A500-A600-A2000)[!].rom"),
var emulator = new Emulator(document.querySelector("#canvas"),
null,
new AMIGALoader(AMIGALoader.model("A2000"),
AMIGALoader.nativeResolution(720, 568),
AMIGALoader.emulatorJS("emulators/amiga/amiga.js"),
AMIGALoader.mountFile("Kickstart v3.1 r40.63 (1993)(Commodore)(A500-A600-A2000)[!].rom",
AMIGALoader.fetchFile("Bios",
"examples/Kickstart v3.1 r40.63 (1993)(Commodore)(A500-A600-A2000)[!].rom")),
AMIGALoader.rom("Kickstart v3.1 r40.63 (1993)(Commodore)(A500-A600-A2000)[!].rom"),
AMIGALoader.mountFile("17Bit-Cyclic.adf",
rustc -O src/httpcommon/lib.rs --out-dir=build -L build
src/httpcommon/headers/stuff.rs:22:9: 22:34 error: missing documentation for a struct
src/httpcommon/headers/stuff.rs:22 pub struct $struct_ident;
^~~~~~~~~~~~~~~~~~~~~~~~~
src/httpcommon/headers/stuff.rs:20:1: 30:2 note: in expansion of header!
src/httpcommon/headers/stuff.rs:32:1: 32:37 note: expansion site
src/httpcommon/lib.rs:24:9: 24:20 note: lint level defined here
src/httpcommon/lib.rs:24 #![deny(missing_doc)]
^~~~~~~~~~~
src/httpcommon/headers/stuff.rs:22:9: 22:34 error: missing documentation for a struct
impl Header for Expires {
fn parse_header(raw: &[Vec<u8>]) -> Option<Expires> {
require_single_field!(raw);
match Header::parse_header(raw) {
Some(tm) => Some(ExpiresDate(tm)),
None => Some(Past),
}
}
fn fmt_header(&self, w: &mut Writer) -> fmt::Result {
@db48x
db48x / gist:a0f68f85fa6ca1420ab8
Last active August 29, 2015 14:01
parser combinators for parsing dice expressions
(defun labeled-dice-expressions ()
(series (either (label)
(nothing))
(either (dice-expression)
(nothing))))
(defun dice-expression ()
(series (sum-expression)
(optional (whitespace))
(token "⇒")
@db48x
db48x / parse.js
Created May 19, 2014 04:28
a simple example of javascript parser combinators
function token(t) {
return function (text) {
if (text[0] == t)
return text.slice(1);
return false;
};
}
function and() {
var args = arguments;