Skip to content

Instantly share code, notes, and snippets.

/*
Speedo converter by jes
How to re-program the board:
Orient the board so the programming header is at top left and the LED is at bottom left.
Pins are as follows, from top:
1. Reset
2. 0 (RX)
3. 1 (TX)
4. +5V
/* magcube solver
* James Stanley 2018
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
/* uncomment this if you want to find new cube sets instead of using the set I settled on, ... */
@jes
jes / xorimg
Created February 17, 2018 21:11
#!/usr/bin/perl
use strict;
use warnings;
use GD;
my $filename1 = shift or die "usage: xorimg ONE.PNG TWO.PNG > OUTPUT.PNG\n";
my $filename2 = shift or die "usage: xorimg ONE.PNG TWO.PNG > OUTPUT.PNG\n";
@jes
jes / protoproxy.go
Last active September 23, 2022 11:53
Run SSH and HTTP on the same port
package main
import (
"fmt"
"net"
"os"
"strings"
)
func main() {
#!/usr/bin/perl
use strict;
use warnings;
use bytes;
my $input = 'BYGRBLBYBLBLBYBRBLGYBYYYBLBYBYBLBYFYBLGYBGRGBGRRBGFRBLBFBLBYBYFLBLBGBYYBBLYYBGRLBYYFBYGRBYFRBLBFBGYFBYRRBGRYBGYFBGRRBLGG';
for my $b (0 .. 5) {
'use strict';
class Markov {
constructor() {
this.maxLength = 30;
this.dict = {};
}
addSentence(text) {
// '\0' is a sentinel marking the beginning + end of sentences
@jes
jes / measurement.go
Created October 26, 2018 11:48
Tor measurement program
package main
import (
"fmt"
"golang.org/x/net/proxy"
"net"
"os"
"strconv"
"time"
)
'use strict';
class Markov {
constructor() {
this.minLength = 6;
this.maxLength = 30;
this.dict = {};
}
addSentence(text) {
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
int main() {
srand(time(NULL));
short *buf = malloc(1048576);
for (int i = 0; i < 1000; i++) {
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <inttypes.h>
// lfsr64 from https://github.com/russm/lfsr64/blob/master/lfsr64.c
uint64_t byte_feedback[256] = {
0x0000000000000000, 0xc70000000000000b, 0x8e0000000000000d, 0x4900000000000006,