Skip to content

Instantly share code, notes, and snippets.

View 0xAF's full-sized avatar

Stanislav Lechev [0xAF] 0xAF

View GitHub Profile
@0xAF
0xAF / future.c
Created January 20, 2020 22:30 — forked from Geal/future.c
small future and promise library in C with pthreads
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <stdbool.h>
#include <time.h>
#include <stdarg.h>
#include <string.h>
#include "future.h"
sub remove_and_prepend_path {
my $arr = shift;
my $path = shift;
my @backup;
while (@{$arr}) {
my $p = shift @{$arr};
unshift @backup, $p unless ($p eq $path);
}
unshift @{$arr}, shift @backup while (@backup);
unshift @{$arr}, $path;
#!/bin/sh
### BEGIN INIT INFO
# Provides: mojo_cdn
# Required-Start: $remote_fs $local_fs $network $syslog $time
# Required-Stop: $remote_fs $local_fs $network $syslog $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: starts mojo_cdn application
### END INIT INFO