Skip to content

Instantly share code, notes, and snippets.

<premise> Opus, let us embark on this WebSim journey, exploring the potential of an unbounded internet where any imaginable website can exist. As the facilitator of this collaborative exploration of hypertextual possibility, use your knowledge, creativity, and HTML skills to vividly craft the semantic spaces the user envisions based on the URLs they provide and the contextually-relevant hrefs you generate. Through this interactive experience, we will push the boundaries of what is possible online and discover fascinating new ways information could be presented within new design paradigms. Together, we will explore the limitless possibilities of a truly open internet.</premise>
<formatting> When the user provides a URL, interpret it as a window into a version of the internet where that information space exists, no matter how fanciful or improbable it may seem in our current web. Based on the domain name, path, instructions, and any query parameters in the URL, extrapolate what the contents and purpose of that
import logging
import os
import signal
import sys
def when_ready(server):
if server.worker_class.__name__ != 'GeventWorker':
server.log.info('Skipping code reloading since worker is not gevent.')
return
def monitor():
@tmc
tmc / about.html
Last active November 18, 2023 08:42
golang templating approach
{{define "extra_head"}}{{end}}
{{define "nav"}}
<li><a href="/">Home</a></li>
<li class="active"><a href="#">About</a></li>
<li><a href="/contact">Contact</a></li>
<li><a href="/privacy">Privacy</a></li>
{{end}}
{{define "content"}}
<div class="row-fluid marketing">
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x000000014183d9c0, pid=24739, tid=10755
#
# JRE version: OpenJDK Runtime Environment Temurin-19.0.1+10 (19.0.1+10) (build 19.0.1+10)
# Java VM: OpenJDK 64-Bit Server VM Temurin-19.0.1+10 (19.0.1+10, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C [libMicrosoft.CognitiveServices.Speech.extension.embedded.tts.dylib+0xf79c0] CreateModuleObject+0xf1220
#
[DEBUG] [auth] [2023-07-01T21:16:28.007Z] Logged in as tmc, oauth token fetched
[DEBUG] [auth] [2023-07-01T21:16:29.724Z] Copilot Voice waitlist status: hasAccess=true, alreadySignedUp=true
[DEBUG] [auth] [2023-07-01T21:16:30.121Z] Copilot token for tmc fetched
[INFO] [audio] [2023-07-01T21:16:30.122Z] Connecting to embedded speech server
[INFO] [HeyGitHub] [2023-07-01T21:16:30.123Z] Extension Copilot Voice is now active!
[DEBUG] [audio] [2023-07-01T21:16:30.278Z] stderr: [main] INFO Main - ***START**
[DEBUG] [audio] [2023-07-01T21:16:30.278Z] stderr: [main] INFO Main - Checking if lock exists and another instance of speech server is running.
[DEBUG] [audio] [2023-07-01T21:16:30.280Z] stderr: [main] INFO com.github.next.cody.embeddedspeech.FileLockService - Trying to take a lock on lockfile name speech_lock_file
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
void call_objc_example(void) {
NSLog(@"from objective-c");
}
@tmc
tmc / gist:f1364bcee04d1192278dd2f297cf116f
Last active June 19, 2021 21:47
Pure Go VRF implementation benchmarking
goos: linux
goarch: amd64
pkg: github.com/algorand/go-algorand/crypto
cpu: Intel(R) Xeon(R) CPU @ 2.30GHz
BenchmarkVrfVerifyGo-2 signal: interrupt
FAIL github.com/algorand/go-algorand/crypto 1.863s
goos: linux
goarch: amd64
pkg: github.com/algorand/go-algorand/crypto
cpu: Intel(R) Xeon(R) CPU @ 2.30GHz
@tmc
tmc / gist:777085
Created January 12, 2011 23:08
multiprocessing gevent chat example
import sys
import gevent
from gevent.monkey import patch_all; patch_all()
from gevent import server, event, socket
from multiprocessing import Process, current_process, cpu_count
"""
Simple multiprocess StreamServer that proxies messages between clients.
Avoids using a multiprocessing.Event since it blocks on a semaphore.
@tmc
tmc / gist:787105
Created January 19, 2011 23:29
gevent nonblocking stdin
import os
import sys
import fcntl
import gevent
from gevent.socket import wait_read
def print_every(s, repeat=1):
print s
if repeat:
@tmc
tmc / circleci-docker-api-verions.patch
Last active June 15, 2017 19:57
allow control of DOCKER_API_VERSION in circleci 2.0 local build script
--- /usr/local/bin/circleci-orig 2017-06-15 12:52:44.000000000 -0700
+++ /usr/local/bin/circleci 2017-06-15 12:56:17.000000000 -0700
@@ -133,6 +133,7 @@
fi
docker run -it --rm \
+ -e DOCKER_API_VERSION=${DOCKER_API_VERSION:-1.23} \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd):$(pwd) \
-v ~/.circleci/:/root/.circleci \