Preact is a fast 3kB alternative to React with the same modern API.
This example uses shows how to use Material UI 4 with Preact X and Preact CLI 3.
git clone blah preact-mui
#include <sys/mman.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() { | |
char *hello = "Hello world!\n"; |
Preact is a fast 3kB alternative to React with the same modern API.
This example uses shows how to use Material UI 4 with Preact X and Preact CLI 3.
git clone blah preact-mui
# Proper (fast) Python implementations of Dan Bernstein's DJB2 32-bit hashing function | |
# | |
# DJB2 has terrible avalanching performance, though. | |
# For example, it returns the same hash values for these strings: "xy", "yX", "z7". | |
# I recommend using Murmur3 hash. Or, at least, FNV-1a or SDBM hashes below. | |
import functools | |
djb2 = lambda x: functools.reduce(lambda x,c: 0xFFFFFFFF & (x*33 + c), x, 5381) | |
sdbm = lambda x: functools.reduce(lambda x,c: 0xFFFFFFFF & (x*65599 + c), x, 0) | |
fnv1a_32 = lambda x: functools.reduce(lambda x,c: 0xFFFFFFFF & ((x^c)*0x1000193), x, 0x811c9dc5) |
dialog { | |
position: fixed; | |
top: 50%; | |
left: 50%; | |
right: auto; | |
padding: 30px; | |
transform: perspective(500px) translate(-50%, -50%); | |
background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF; | |
border: none; | |
border-radius: 3px; |
A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.
Workshop Instructor:
This workshop is distributed under a CC BY-SA 4.0 license.
Chinese Brand "ITworks" , Model TW891, distributed in France and Belgium by Darty
#!/bin/bash | |
IPSET="/usr/sbin/ipset" | |
CURL="/usr/bin/curl" | |
DATE="/bin/date" | |
for VER in 4 6; do | |
URL="https://www.cloudflare.com/ips-v$VER" | |
SET_NAME="CloudFlare.IPv$VER" |
-- Example table | |
CREATE TABLE ring_buffer (id INTEGER PRIMARY KEY AUTOINCREMENT, data TEXT); | |
-- Number 10 on where statement defines the ring buffer's size | |
CREATE TRIGGER delete_tail AFTER INSERT ON ring_buffer | |
BEGIN | |
DELETE FROM ring_buffer WHERE id%10=NEW.id%10 AND id!=NEW.id; | |
END; |