CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Fri, 22 Aug 2025 03:28:00 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20161024164412
location: https://web.archive.org/web/20161024164412/https://gist.github.com/267014
server-timing: captures_list;dur=1.002843, exclusion.robots;dur=0.041316, exclusion.robots.policy;dur=0.024452, esindex;dur=0.014129, cdx.remote;dur=9.690980, LoadShardBlock;dur=56.176974, PetaboxLoader3.datanode;dur=41.436941
x-app-server: wwwb-app201
x-ts: 302
x-tr: 100
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app201; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 302
server: nginx
date: Fri, 22 Aug 2025 03:28:02 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20230629164501
location: https://web.archive.org/web/20230629164501/https://gist.github.com/267014
server-timing: captures_list;dur=0.530767, exclusion.robots;dur=0.022849, exclusion.robots.policy;dur=0.013820, esindex;dur=0.009010, cdx.remote;dur=59.026740, LoadShardBlock;dur=239.665542, PetaboxLoader3.datanode;dur=322.268753, PetaboxLoader3.resolve;dur=625.561019, load_resource;dur=788.644764
x-app-server: wwwb-app201
x-ts: 302
x-tr: 1116
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 302
server: nginx
date: Fri, 22 Aug 2025 03:28:04 GMT
content-type: text/html; charset=utf-8
content-length: 0
x-archive-orig-server: GitHub.com
x-archive-orig-date: Thu, 29 Jun 2023 16:45:01 GMT
x-archive-orig-vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With
location: https://web.archive.org/web/20230629164501/https://gist.github.com/dustin/267014
x-archive-orig-cache-control: no-cache
x-archive-orig-strict-transport-security: max-age=31536000; includeSubdomains; preload
x-archive-orig-x-frame-options: deny
x-archive-orig-x-content-type-options: nosniff
x-archive-orig-x-xss-protection: 0
x-archive-orig-referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
x-archive-orig-content-security-policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com objects-origin.githubusercontent.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com cdn.optimizely.com logx.optimizely.com/v1/events *.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ wss://*.actions.githubusercontent.com github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com objects-origin.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/
x-archive-orig-set-cookie: _gh_sess=brVW7Xdu%2BPdAzHD8x1SeSiNrbDpps1pHKW0GAJWWFdTbXxR50G7qCocEIXxvgAQUMSyLlykC2FNCWJ94vd8Jndq7F1%2B5hbDdfhf3DTrIRJbkwOG4IMf9fnMH9HFAA%2Fu7rmPl0OT%2FcaBm6OXp1hwBG05IubLAuQsKti74ri9%2FS81Pu4D1G6470Ud4NE4kYoizk9wiIwx7ums%2FBRRQX0rRTJx7XHNcQif473vNvD3fLGPbvKG3yosZ%2FEGrfhGVz3F6LKwLejxuEKz7SoEAXHPCyw%3D%3D--CHHDkr07Y6g%2FluTy--UGq2YAi9%2BIzaqu9paPwyIQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
x-archive-orig-set-cookie: _octo=GH1.1.1573741899.1688057101; Path=/; Domain=github.com; Expires=Sat, 29 Jun 2024 16:45:01 GMT; Secure; SameSite=Lax
x-archive-orig-set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sat, 29 Jun 2024 16:45:01 GMT; HttpOnly; Secure; SameSite=Lax
x-archive-orig-content-length: 0
x-archive-orig-x-github-request-id: A8AE:0B5F:82918D:C36A6A:649DB50D
cache-control: max-age=1800
memento-datetime: Thu, 29 Jun 2023 16:45:01 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Mon, 24 Oct 2016 16:44:12 GMT", ; rel="prev memento"; datetime="Mon, 24 Oct 2016 16:44:12 GMT", ; rel="memento"; datetime="Thu, 29 Jun 2023 16:45:01 GMT", ; rel="last memento"; datetime="Thu, 29 Jun 2023 16:45:01 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: spn2-20230629170721/spn2-20230629145518-wwwb-spn12.us.archive.org-8005.warc.gz
server-timing: captures_list;dur=2.139377, exclusion.robots;dur=0.028381, exclusion.robots.policy;dur=0.017177, esindex;dur=0.012875, cdx.remote;dur=23.148894, LoadShardBlock;dur=91.388171, PetaboxLoader3.datanode;dur=124.620276, load_resource;dur=1840.536471, PetaboxLoader3.resolve;dur=1793.935897
x-app-server: wwwb-app201
x-ts: 302
x-tr: 1987
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Fri, 22 Aug 2025 03:28:04 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: GitHub.com
x-archive-orig-date: Thu, 29 Jun 2023 16:45:01 GMT
x-archive-orig-vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With
x-archive-orig-etag: W/"ae1db3040d99e6a30d5a303980f7c628"
x-archive-orig-cache-control: max-age=0, private, must-revalidate
x-archive-orig-strict-transport-security: max-age=31536000; includeSubdomains; preload
x-archive-orig-x-frame-options: deny
x-archive-orig-x-content-type-options: nosniff
x-archive-orig-x-xss-protection: 0
x-archive-orig-referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
x-archive-orig-content-security-policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com objects-origin.githubusercontent.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com cdn.optimizely.com logx.optimizely.com/v1/events *.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ wss://*.actions.githubusercontent.com github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com objects-origin.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/
x-archive-orig-set-cookie: _gh_sess=3gHrncbgauI7L2N9cDr3Oj1AqLW5Hjg468YaOkfZ11W71jsbD5BmlxJr8mHEkcrxLhfC5vlqZMHlNTdjkzLxgdQBd7KRRQMz4RdhQcAkl%2B868%2BSh5etrh5hvBnQFw40rOrHGrj97qkg5fqcZs0mLEnE2E7BXYRQ8m4BlDahPlLpb3sXcSNb8PmykhK6RBTC0VJfeL%2BPdc9hMe%2FJtASWHkQazSeJNL2z%2Bu%2FhWkfxU9Ko45bWqc%2BmUwjE4oWPGh5g1mlTbZTLgr%2Fr2RqX8G00VvA%3D%3D--4vENTC3aDxMt2A%2B3--FQ2UBE5wYWX5uLPwmIJ22w%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
x-archive-orig-set-cookie: _octo=GH1.1.1567654781.1688057101; Path=/; Domain=github.com; Expires=Sat, 29 Jun 2024 16:45:01 GMT; Secure; SameSite=Lax
x-archive-orig-set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sat, 29 Jun 2024 16:45:01 GMT; HttpOnly; Secure; SameSite=Lax
x-archive-orig-accept-ranges: bytes
x-archive-orig-transfer-encoding: chunked
x-archive-orig-x-github-request-id: 8780:5ECC:81D75E:C1AF9F:649DB50D
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Thu, 29 Jun 2023 16:45:01 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Thu, 29 Jun 2023 16:45:01 GMT", ; rel="memento"; datetime="Thu, 29 Jun 2023 16:45:01 GMT", ; rel="last memento"; datetime="Thu, 29 Jun 2023 16:45:01 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: spn2-20230629170721/spn2-20230629162204-wwwb-spn11.us.archive.org-8004.warc.gz
server-timing: captures_list;dur=1.082581, exclusion.robots;dur=0.044813, exclusion.robots.policy;dur=0.025904, esindex;dur=0.018871, cdx.remote;dur=11.319759, LoadShardBlock;dur=135.391633, PetaboxLoader3.datanode;dur=76.107620, load_resource;dur=62.958530
x-app-server: wwwb-app201
x-ts: 200
x-tr: 326
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
My countdown timer as seen on TV: https://www.youtube.com/watch?v=Qv_ruj4lhXo · GitHub
{{ message }}
Instantly share code, notes, and snippets.
My countdown timer as seen on TV: https://www.youtube.com/watch?v=Qv_ruj4lhXo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
#define SERVO 11 | |
byte leds[] = { 4, 5, 6, 7, 8, 9 }; | |
#define NLEDS 6 | |
// Manually placing the pointer since the actual labels | |
// ended up being slightly off. | |
// 5 4 3 2 1 | |
byte positions[] = { 148, 119, 79, 52, 27, 0 }; | |
Servo servo; | |
void setup() { | |
Serial.begin(9600); | |
// Initialize the countdown LEDS | |
for(int i = 0; i < NLEDS; i++) { | |
pinMode(leds[i], OUTPUT); | |
digitalWrite(leds[i], LOW); | |
} | |
// Point the servo at 0 | |
servo.attach(SERVO); | |
setAndWait(); | |
} | |
void setAndWait() { | |
servo.write(180); | |
Serial.println("hello"); | |
// Turn off all the lights. | |
for(int i = 0; i < NLEDS; i++) { | |
digitalWrite(leds[i], LOW); | |
} | |
// Wait for my signal | |
bool readyToGo = false; | |
while(!readyToGo) { | |
byte b = Serial.read(); | |
switch(b) { | |
case 'g': // GO! | |
readyToGo = true; | |
break; | |
case 's': // Synchronize | |
Serial.println("s"); | |
// blink a sync pattern | |
for(int i = 0; i < NLEDS; i++) { | |
digitalWrite(leds[i], HIGH); | |
delay(10); | |
digitalWrite(leds[i], LOW); | |
} | |
break; | |
default: | |
delay(50); | |
} | |
} | |
for(int i = 0; i<NLEDS; i++) { | |
digitalWrite(leds[i], HIGH); | |
servo.write(positions[i]); | |
delay(1000); | |
digitalWrite(leds[i], LOW); | |
} | |
} | |
void blinkErratically() { | |
// Select a random light to blink. | |
int led = leds[random(0, NLEDS)]; | |
digitalWrite(led, HIGH); | |
delay(random(20, 100)); | |
digitalWrite(led, LOW); | |
delay(random(20, 100)); | |
} | |
void loop() { | |
// If the control channel sends an 'r' command, reset state. | |
// This allows testing and stuff. | |
if (Serial.available() && Serial.read() == 'r') { | |
setAndWait(); | |
} | |
blinkErratically(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# worse is better | |
import os | |
import sys | |
import time | |
import serial | |
def timeTilNearest(secondFactor): | |
t = int(time.time()) | |
nearest = 10 | |
nextT = (int(t / secondFactor) * secondFactor) + secondFactor | |
duration = nextT - t | |
return duration | |
def sync(ser): | |
print "Sending sync cmd..." | |
ser.write("s") | |
ser.flush() | |
print "Waiting for sync response." | |
b = ser.readline().strip() | |
print "Read", repr(b) | |
assert(b == 's') | |
if __name__ == '__main__': | |
ser = serial.Serial("/dev/tty.usbserial-A900acmg") | |
print ser.readline().strip() | |
sync(ser) | |
t = time.time() | |
duration = timeTilNearest(3600) | |
# duration = timeTilNearest(30) | |
nextT = t + duration | |
while t < nextT - 10: | |
# Compute the time on each iteration. | |
then = nextT - t - 10 | |
duration = min(15, then) | |
print "It's now %s, flashing in %ds at %s" % (time.ctime(t), | |
then, time.ctime(nextT)) | |
if nextT - t < 600: | |
sync(ser) | |
time.sleep(max(0, duration)) | |
t = time.time() | |
t = time.time() | |
print "Counting down at %s (%f to go)" % (time.ctime(t), nextT - t) | |
for w in (10, 9, 8, 7): | |
# Do a vocal countdown. I recalculate the time duration on | |
# each request so I don't have to worry about how long it | |
# takes to issue the say command. | |
duration = nextT - w - time.time() | |
print "Sleeping at %d for %f" % (w, duration) | |
time.sleep(max(0, duration)) | |
os.system("say %d" % w) | |
print "Adjusting volume and stuff at %s." % (time.ctime(time.time())) | |
os.system("""osascript -e 'tell application "iTunes" to pause'""") | |
os.system("""osascript -e 'tell application "iTunes" to set sound volume to 100' &""") | |
os.system("say 6") | |
time.sleep(max(0, nextT - time.time() - 5)) | |
print "Executing at %s" % time.ctime(time.time()) | |
ser.write("g\n") | |
ser.flush() | |
time.sleep(1) | |
print "Playing music" | |
os.system("""osascript -e 'tell application "iTunes" to play track named "Auld Lang Syne"'""") | |
# How long to do the light show. | |
time.sleep(108) | |
print "Sending an r" | |
ser.write("r\n") | |
ser.flush() | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can’t perform that action at this time.