Skip to content

Instantly share code, notes, and snippets.

View maxhawkins's full-sized avatar

Max Hawkins maxhawkins

View GitHub Profile
package main
import (
"flag"
"fmt"
"log"
"unsafe"
"modernc.org/libc"
"modernc.org/libc/sys/types"
-- subscribers
DROP TABLE IF EXISTS subscribers;
CREATE TABLE subscribers (
id INTEGER PRIMARY KEY,
uuid TEXT NOT NULL UNIQUE,
email TEXT NOT NULL UNIQUE,
name TEXT NOT NULL,
attribs TEXT NOT NULL DEFAULT '{}' CHECK (json(attribs) IS NOT NULL),
status TEXT NOT NULL DEFAULT 'enabled' CHECK (status IN ('enabled', 'disabled', 'blocklisted')),
campaigns TEXT CHECK (json_array_length(campaigns) > 0),
@maxhawkins
maxhawkins / 0.md
Last active March 12, 2020 04:14
Random Twitter feed

I wrote this script to wrest some control over the content I see from the Twitter algorithm.

It mutes everyone I follow and un-mutes 30 random people.

You can run it as a scheduled Firebase Cloud Function so you have a new feed every day.

@maxhawkins

@maxhawkins
maxhawkins / public_printer.md
Last active October 28, 2019 05:46
How to Make Your Printer Public

tweet

How to Make Your Printer Public

This September I decided to share my laser printer so anyone on the internet could send me printed messages.

Within a few days I got hundreds of fun print-outs from people all over the world.

Using Google Cloud Print, you can easily make your printer public too. Here's how to do it:

@maxhawkins
maxhawkins / domains.md
Last active January 13, 2021 07:06
Domains registered before 1995
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import html
import random
import requests
import sys
def get_abstract(abstract_id):
@maxhawkins
maxhawkins / daily_schedule.go
Last active October 12, 2017 04:54
Random Daily Schedule Generator
// package main provides a random daily schedule generator
package main
import (
"fmt"
"math/rand"
"strings"
"time"
)
@maxhawkins
maxhawkins / schotter.pde
Created January 11, 2011 03:30
Processing copy of Georg Nees's classic media art piece Schotter.
// Support Classes
class Vec3f {
float x, y, z;
Vec3f(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
}
void scale(float scale) {
this.x *= scale;
@maxhawkins
maxhawkins / schotter.cpp
Created January 10, 2011 23:41
LibCinder copy of Georg Nees's classic media art piece Schotter.
#include "cinder/app/AppBasic.h"
#include "cinder/gl/gl.h"
#include "cinder/Rand.h"
using namespace ci;
using namespace ci::app;
using namespace std;
const Vec3f DrawingOffset = Vec3f(50, 50, 0);
const Vec2f DrawingDimensions = Vec2f(12, 23);
@maxhawkins
maxhawkins / sketchup.rb
Created July 1, 2010 23:19
Demo code for Google Sketchup - pghrb resentation
# Sketchup & Ruby
#
# Pittsburgh.rb Presentation
# 7/1/10
# Draw rectangle
model = Sketchup.active_model
entities = model.entities
model.selection.add entities.to_a.last