This file contains hidden or 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 perl | |
# A hex dumping function I use for work purposes. | |
use warnings; | |
use strict; | |
hex_dump("ABCDEFGHIJKLMNOPQRTUVWXYZ0123456789"); | |
sub hex_dump { | |
my ($payload) = @_; |
This file contains hidden or 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 std::collections::VecDeque; | |
use itertools::Itertools; | |
#[derive(PartialEq)] | |
enum AddressingMode { | |
Position, | |
Immediate, | |
} |
This file contains hidden or 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
# Conway's Game of Life | |
# | |
# Initialises the canvas randomly | |
# | |
# nimble install sdl2 | |
# nim c -r life.nim | |
from random import randomize, rand | |
import sdl2 |
This file contains hidden or 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
// Conway's Game of Life | |
// | |
// Initialises the canvas randomly | |
// | |
// zig run life.zig -isystem /usr/local/include --library sdl2 | |
const std = @import("std"); | |
const os = std.os; | |
const warn = std.debug.warn; | |
const c = @cImport({ |
This file contains hidden or 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
/* | |
* Conway's Game of Life | |
* | |
* Press any key to re-initialise :) | |
* Click the window to exit. | |
* | |
* gcc -std=c99 -lsdl2 -Wall -Werror -Wpedantic -Wno-unused-function -o life life.c | |
*/ | |
#include <stdio.h> |
This file contains hidden or 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
FROM perl:5.28 | |
RUN curl -L http://cpanmin.us | perl - App::cpanminus | |
RUN cpanm Carton | |
COPY app.psgi /app/app.psgi | |
COPY cpanfile /app/cpanfile | |
COPY cpanfile.snapshot /app/cpanfile.snapshot | |
RUN cd /app && carton install --deployment |
This file contains hidden or 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 perl | |
use v5.10; | |
use warnings; | |
use strict; | |
use EV; | |
use AnyEvent; | |
use POSIX qw(); |
This file contains hidden or 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 perl | |
use v5.10; | |
use warnings; | |
use strict; | |
use EV; | |
use AnyEvent; | |
# XXX comment this out, and it works |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
int main(void) | |
{ | |
pid_t pid = fork(); |
This file contains hidden or 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 perl | |
use v5.10; | |
use warnings; | |
use strict; | |
use EV; | |
use AnyEvent; | |
use Sys::Hostname qw(hostname); |
NewerOlder