Skip to content

Instantly share code, notes, and snippets.

View spedru's full-sized avatar

Spödro Spedru spedru

View GitHub Profile

Keybase proof

I hereby claim:

  • I am spedru on github.
  • I am yuuko (https://keybase.io/yuuko) on keybase.
  • I have a public key whose fingerprint is 590B DD1C 7092 7A8D 184E DD66 0145 9C0B 579E 5AEA

To claim this, I am signing this object:

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
int vasprintf(char **strp, const char *fmt, va_list ap)
{
char buf;
va_list ap2;
va_copy(ap2, ap);
int len = vsnprintf(&buf, 1, fmt, ap) + 1;
@spedru
spedru / bubble.go
Created May 11, 2015 20:06
absolutely stupid
package main
import (
"fmt"
"os"
"strings"
"time"
"unicode/utf8"
)
### Keybase proof
I hereby claim:
* I am yuukosama on github.
* I am yuuko (https://keybase.io/yuuko) on keybase.
* I have a public key whose fingerprint is 590B DD1C 7092 7A8D 184E DD66 0145 9C0B 579E 5AEA
To claim this, I am signing this object:
@spedru
spedru / bubble.c
Last active August 29, 2015 14:16
/* cum pile with -std=c99 or -std=c11 */
#define _POSIX_C_SOURCE 200809L
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
static const struct timespec sleepytime = {0, 70000000};
@spedru
spedru / binary.c
Created January 25, 2015 08:15
absolutely haram
/*
* binary.c
* by yuuko
*
* This file is intended to never exceed 200 LOC.
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* Version 2, December 2004
*
* Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
@spedru
spedru / stringprocessing.c
Created November 24, 2014 21:13
CS assignment; really ugly
#include <stdio.h>
#include <string.h>
int main(void)
{
char strings[2][255], halves[2][127];
size_t len[2];
for(int i = 0; i < 2; i++)
{
printf("Enter string %d: ", i + 1);
@spedru
spedru / rancol.c
Last active August 29, 2015 14:10
holy shit this is stupid
#include <stdio.h>
#include <unistd.h>
extern long int random(void);
extern void srandom(unsigned int seed);
extern int isatty(int);
extern int fileno(FILE *stream);
extern long int strtol(const char *nptr, char **endptr, int base);
int main(int argc, char *argv[])