Skip to content

Instantly share code, notes, and snippets.

@pervognsen
pervognsen / shift_dfa.md
Last active November 1, 2024 23:53
Shift-based DFAs

A traditional table-based DFA implementation looks like this:

uint8_t table[NUM_STATES][256]

uint8_t run(const uint8_t *start, const uint8_t *end, uint8_t state) {
    for (const uint8_t *s = start; s != end; s++)
        state = table[state][*s];
    return state;
}
@enricofoltran
enricofoltran / main.go
Last active October 3, 2024 14:08
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@anarchivist
anarchivist / pcdm-profile-template.md
Last active October 24, 2017 15:46
Profile template for PCDM-based models

title: PCDM Profile Template author:

  • Mark A. Matienzo
  • Christina Harlow date: 2016-10-20 profile: project: PCDM Profiles namespaces: pcdm: http://pcdm.org/models#
@atomotic
atomotic / warc-formats.go
Last active August 29, 2015 14:26
warc-formats
package main
import (
"bufio"
"bytes"
"fmt"
"github.com/richardlehane/siegfried"
"github.com/slyrz/warc"
"io/ioutil"
"log"
{
"@context": {
"@vocab": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"dpla": "http://dp.la/terms/",
"edm": "http://www.europeana.eu/schemas/edm/",
"geo": "http://www.w3.org/2003/01/geo/wgs84_pos#",
"lcsh": "http://id.loc.gov/authorities/subjects/",
"ore": "http://www.openarchives.org/ore/terms/",
"skos": "http://www.w3.org/2004/02/skos/core#",
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active November 5, 2024 18:44
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: