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
package main | |
import "fmt" | |
func Fold(type T, U)(acc T, f func(T, U) T, xs []U) T { | |
for _, x := range xs { | |
acc = f(acc, x) | |
} | |
return acc |
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::fmt; | |
use std::io; | |
use thiserror::Error; | |
fn main() { | |
let mut bf = Bf::new(1000, true); | |
let mut input = String::new(); | |
loop { | |
match io::stdin().read_line(&mut input) { | |
Ok(0) => return, |
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
// Download index file: wget https://www.cpan.org/modules/02packages.details.txt. | |
use std::{ | |
collections::HashSet, | |
fmt::Display, | |
fs::File, | |
io::{self, BufReader}, | |
}; | |
fn main() -> io::Result<()> { |
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 python3 | |
import os | |
import sys | |
import time | |
import prctl | |
import signal | |
def do_the_thing(): | |
pid = os.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
package main | |
import ( | |
"flag" | |
"fmt" | |
"math" | |
"math/rand" | |
"os" | |
"runtime/debug" | |
"strings" |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"os" | |
"time" |
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
package main | |
import ( | |
"log" | |
"math/rand" | |
"net/http" | |
"os" | |
"os/signal" | |
"time" |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"go/build" | |
"go/types" | |
"os" | |
"golang.org/x/tools/go/loader" |
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
package main | |
// heavily inspired by https://blog.nelhage.com/2010/08/write-yourself-an-strace-in-70-lines-of-code/ | |
import ( | |
"errors" | |
"fmt" | |
"log" | |
"os" | |
"strconv" |
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 v5.14; [6/1836] | |
use warnings; | |
use IO::Socket; | |
use POSIX qw(:sys_wait_h); | |
my($ip, $host) = @ARGV; | |
my $sock = IO::Socket::INET->new( | |
PeerAddr => "$ip:80", |
NewerOlder