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
# quic-cleanup.pl | |
# | |
# When running the Google experimental quic_server it expects to find | |
# sites to serve in /tmp/quic-data. Under that there will be a | |
# directory per site. | |
# | |
# For example this was used to mirror the CloudFlare web site for | |
# QUIC testing. | |
# | |
# mkd |
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
$(call to_n,4) = $(words ) $(if $(filter-out 4,$(words x )),$(call to_n,4,x )) # $1 == 4, $2 is blank | |
= 0 $(if $(filter-out 4,1),$(call to_n,4,x )) # $(filter-out 4,1) is 1 | |
= 0 $(if 1,$(call to_n,4,x )) # So the $(call) will happen | |
= 0 $(call to_n,4,x ) | |
= 0 $(words x ) $(if $(filter-out 4,$(words x x )),$(call to_n,4,x x )) | |
= 0 1 $(if $(filter-out 4,2)),$(call to_n,4,x x )) # $(filter-out 4,2) is 2 | |
= 0 1 $(if 2,$(call to_n,4,x x)) # So the $(call) will happen | |
= 0 1 $(call to_n,4,x x) | |
= 0 1 $(words x x ) $(if $(filter-out 4,$(words x x x)),$(call to_n,4,x x x )) | |
= 0 1 2 $(if $(filter-out 4,3),$(call to_n,4,x x x )) # $(filter-out 4,3) is 3 |
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
// Copyright (c) 2014 John Graham-Cumming | |
// | |
// Takes a CSV containing rows in the form | |
// | |
// ip,name | |
// | |
// Connects to 'ip' on port 443 using TLS presenting the SNI name 'name' and | |
// verifies the result. | |
package main |
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
int b = 100; | |
int s = 640; | |
int w = b*(s/b); | |
int h = w; | |
void setup() { | |
background(0); | |
size(w, h); | |
int side = w/b - 1; | |
int x; |
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 "stdint.h" | |
#include "stdio.h" | |
void main(int argc, void *argv[]) { | |
uint64_t i; | |
for (i = 0; i < 2^32; i++) { | |
uint32_t x = (uint32_t)i; | |
uint32_t l = (-x-1) & 0xffff; | |
uint32_t r = ~x & 0xffff; | |
if (l != r) { |
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
use strict; | |
use warnings; | |
my @alpha = split('', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'); | |
my %frequencies = ( 'A' => 84, 'B' => 23, 'C' => 21, 'D' => 46, 'E' => 116, | |
'F' => 20, 'G' => 25, 'H' => 49, 'I' => 76, 'J' => 2, | |
'K' => 5, 'L' => 38, 'M' => 34, 'N' => 66, 'O' => 66, | |
'P' => 15, 'Q' => 2, 'R' => 64, 'S' => 73, 'T' => 81, | |
'U' => 19, 'V' => 11, 'W' => 21, 'X' => 2, 'Y' => 24, |
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
func doMightError() (err error) { | |
if err = doFirst(); err != nil { | |
return | |
} | |
if err = doSecond(); err != nil { | |
return | |
} | |
if err = doThird(); err != nil { |
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
func doMightError() (err error) { | |
switch { | |
case !doFirst(&err): | |
case !doSecond(&err): | |
case !doThird(&err): | |
default: | |
moreStuff() | |
} | |
return |
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
id := make(chan string) | |
count := make(chan int) | |
go func() { | |
h := sha1.New() | |
w := counter.New(h) | |
c := []byte(time.Now().String()) | |
w.Write(c) | |
for { | |
select { |
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
use strict; | |
use warnings; | |
use WWW::Mechanize; | |
use DB_File; | |
my %signed; | |
tie %signed, "DB_File", "signed", O_RDWR|O_CREAT, | |
0666, $DB_HASH or die "Failed to open signed\n"; |
OlderNewer