Skip to content

Instantly share code, notes, and snippets.

View printimage.c
/*bin/echo ' -*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;coding:utf-8 -*-┤
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
│ To the extent possible under law, Justine Tunney has waived │
│ all copyright and related or neighboring rights to this file, │
│ as it is written in the following disclaimers: │
│ • http://unlicense.org/ │
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
╚────────────────────────────────────────────────────────────────────'>/dev/null
if ! [ "${0%.*}.exe" -nt "$0" ]; then
View proxy.py
#!/usr/bin/env python2
import BaseHTTPServer
import SocketServer
import base64
import httplib
import mimetypes
import os
import shutil
import ssl
@jart
jart / fone.go
Last active Jun 6, 2020
Linux CLI Telephone in 300 lines of Go. This is a NAT traversing SIP user agent. It can hook into the PSTN via gateways like Flowroute. The keyboard can be used to send DTMF tones.
View fone.go
// To the extent possible under law, Justine Tunney has waived
// all copyright and related or neighboring rights to this file,
// as it is written in the following disclaimers:
// - http://unlicense.org/
// - http://creativecommons.org/publicdomain/zero/1.0/
package main
// #cgo pkg-config: ncurses libpulse-simple
// #include <stdlib.h>
View rmsiface.txt
RMS NOTATION TUTORIAL
BEHAVIOR
=: write-only
+: read/writeable
&: earlyclobber (impacts register sharing, defensive copying, etc.)
%: commutative
,: groups alternative constraints
?: discourages group of constraints
@jart
jart / fastio.py
Created Oct 23, 2016
Multithreaded Python os.walk
View fastio.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@jart
jart / sip.rl
Created Mar 12, 2018
gossip sip parser definition
View sip.rl
%%{# -*-ragel-*-
#
## SIP Message Parser Definition
#
# The parser should be a linearly complex FSM. It should be able to parse a
# real-world SIP INVITE in less than 30μs. This parser only trades speed in
# favor of friendly data structures, which are big structs linked together.
#
## Implementation Notes
#
View mkcc.sh
#!/bin/sh
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
View NonBlockingThreadPool.diff
--- /tmp/NonBlockingThreadPool.h 2018-05-25 12:50:34.146863121 -0700
+++ NonBlockingThreadPool.h 2018-05-25 12:48:54.000000000 -0700
@@ -10,6 +10,7 @@
#ifndef EIGEN_CXX11_THREADPOOL_NONBLOCKING_THREAD_POOL_H
#define EIGEN_CXX11_THREADPOOL_NONBLOCKING_THREAD_POOL_H
+#include <iostream>
namespace Eigen {
@jart
jart / isort.c
Last active May 27, 2020
Simple macro that makes djbsort (crypto submission reference impl version) 40% faster and 10% smaller
View isort.c
/*bin/echo '───────────────────────────────────────────────────────╗
│ To the extent possible under law, Justine Tunney has waived │
│ all copyright and related or neighboring rights to this file, │
│ as it is written in the following disclaimers: │
│ • http://unlicense.org/ │
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
╚────────────────────────────────────────────────────────'>/dev/null
CC=${CC:-cc}
CFLAGS=${CFLAGS:--g -Wall -Werror -Os -fno-pie -march=native}
$CC $CFLAGS -o isort.o -c isort.c &&
View gist:0a6a402b480e7dbcf8e61895759f2058
/********************************************************\
* *
* Ultra-hot screen management package *
* *
\********************************************************/
/***********************************************************-*****
You can’t perform that action at this time.