Skip to content

Instantly share code, notes, and snippets.

View ross-spencer's full-sized avatar
💭
🖖

Ross Spencer ross-spencer

💭
🖖
View GitHub Profile
@marianogappa
marianogappa / ordered_parallel.go
Last active February 12, 2024 09:27
Parallel processing with ordered output in Go
/*
Parallel processing with ordered output in Go
(you can use this pattern by importing https://github.com/MarianoGappa/parseq)
This example implementation is useful when the following 3 conditions are true:
1) the rate of input is higher than the rate of output on the system (i.e. it queues up)
2) the processing of input can be parallelised, and overall throughput increases by doing so
3) the order of output of the system needs to respect order of input
- if 1 is false, KISS!
@konradko
konradko / golang_on_rpi.md
Last active April 12, 2020 17:36
Install Golang 1.7 on Raspberry Pi
wget https://storage.googleapis.com/golang/go1.7.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.7.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
@cmharlow
cmharlow / pcdm_filesets_testing.md
Last active December 2, 2021 09:00
Testing PCDM modeling with Fileset options (PCDM PRs #68, #69) for existing Cornell use cases
@zacharyvoase
zacharyvoase / 5syllable_with_penultimate_emphasis.sh
Last active July 11, 2022 18:21
5-syllable words with the emphasis on the penultimate syllable
$ curl 'http://dingo.sbs.arizona.edu/~hammond/lsasummer03/newdic.txt' | awk '$2 ~ /^...''.$/ { print $4 }'
abbreviation
abracadabra
academician
accelerando
accommodation
acculturation
adjudication
alienation
alleviation
@chrpr
chrpr / pcdm.ttl
Last active December 2, 2021 09:21
PCDM as Turtle
charper:~$ rapper -i rdfxml -o turtle models.rdf -O https://raw.githubusercontent.com/duraspace/pcdm/master/models.rdf
rapper: Parsing URI file:///home/charper/models.rdf with parser rdfxml
rapper: Serializing with serializer turtle and base URI https://raw.githubusercontent.com/duraspace/pcdm/master/models.rdf
@base <https://raw.githubusercontent.com/duraspace/pcdm/master/models.rdf> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix ore: <http://www.openarchives.org/ore/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@anjackson
anjackson / breakdown.md
Last active November 9, 2015 00:27
Ideal WARC ID result?

When analysing example.warc.gz containing a HTML response that was GZip encoded.

  • application/warc
    • application/gzip
      (outer gzip chunk)
      • application/warc; version="1.0", type=response
        (The whole WARC Record)
        • application/http; msgtype=response
          (WARC Record content, i.e. HTTP headers and entity body)
          • application/gzip
            (i.e. the entity body is compressed)
            • text/html; version=5
// PREPARATORY CHANGES TO SF
1. Use existing -hash flag but change behaviour so can accept a comma separated list of hashes e.g. -hash md5,ssdeep
2. change hash.go file (under /cmd/) so that checksum var is a slice of hashes var checksum []hash.Hash
3. writer interface (cmd/writers.go) updated so writeFile method takes a slice of byte slices for checksum digests (checksum [][]byte)
And all writers (JSON, CSV, YAML etc) updated so they can accept multiple checksum digests.
4. in cmd/sf.go update the identifyRdr func so it ranges through the slice of checksums, calculating for each, and returns a slice of byte slices for checksum digests
// SQLITEANALYSIS CHANGES
5. copy the hash.go flag as hash_sqliteanalysis.go and prepend build tag
6. add spamspam as an import and update the functions in this file
{
"formats": [
{
"format": {
"id": "archives-nz-dev-signature/1",
"name": "Adobe Air",
"version": "1.0",
"mime": "application/vnd.adobe.air-application-installer-package+zip",
"extensions": [
"air"
@paniq
paniq / pico8.txt
Last active March 20, 2022 21:11
PICO-8 hacks & secrets
Screen resolutions
------------------
PICO-8 supports different undocumented videomodes that can be activated at runtime,
using poke(0x5F2C, X) where X is one of the following mode numbers:
0: 128x128, 0 pages
1: 64x128, 1 page
2: 128x64, 1 page
3: 64x64, 3 pages