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
import { createServer, Socket } from "net"; | |
// Promisified socket.write(). | |
const write = (socket: Socket, data: Buffer | string) => | |
new Promise((resolve, reject) => | |
socket.write(data as Buffer, (error: Error | undefined) => { | |
if (error) { | |
reject(); | |
} else { | |
resolve(); |
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
; 10 SYS (4096) | |
*=$0801 | |
BYTE $0E, $08, $0A, $00, $9E, $20, $28, $34, $30, $39, $36, $29, $00, $00, $00 | |
*=$1000 | |
start |
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
const std = @import("std"); | |
const Buffer = std.ArrayList(u8); | |
const source = [_]u8{ 1, 2, 3, 4, 5 }; | |
const expectedOrder = [_]u8{ 1, 2, 3, 4, 5, 5, 4, 3, 2, 1 }; | |
fn recursive(read: []const u8, write: *Buffer) !void { | |
if (read.len > 0) { | |
try write.append(read[0]); |
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
const std = @import("std"); | |
fn Signal(comptime T: type) type { | |
return struct { | |
message: T, | |
readyToRecieveMessage: std.Thread.Semaphore, | |
messageHasBeenSet: std.Thread.Semaphore, | |
const Self = @This(); |
OlderNewer