Skip to content

Instantly share code, notes, and snippets.

View Keyaku's full-sized avatar

António Sarmento Keyaku

  • Portugal
  • 09:58 (UTC +01:00)
View GitHub Profile
@Keyaku
Keyaku / stack.c
Last active July 18, 2021 16:09
A simple but effective Stack structure in C for School projects.
#include <stdlib.h>
#include <string.h>
#include "stack.h"
Stack *stack_new(Stack *st, size_t size, bool (*equals)(const void*, const void*))
{
if (size <= 0) return NULL;
st->idx = 0;
@Keyaku
Keyaku / queue.c
Last active July 18, 2021 16:09
A simple but effective Queue structure in C for School projects.
#include <stdlib.h>
#include <string.h>
#include "queue.h"
Queue *queue_new(Queue *q, size_t size, bool (*equals)(const void*, const void*))
{
if (size <= 0) return NULL;
q->data = malloc((size+1)* sizeof(*q->data), false);
@Keyaku
Keyaku / main.m
Created May 20, 2016 07:08
Check for Metal capability on your Mac OS X system. 10.11 & above only!
/*
** Compile in terminal with the following line:
** clang main.m -framework Foundation -framework Metal -o TestMetal
*/
#import <Foundation/Foundation.h>
#import <Metal/Metal.h>
int main(void) {
@autoreleasepool {
@Keyaku
Keyaku / workdir.spn
Last active March 7, 2016 06:21
Lets you work extensively with files and directories via Sparkling
/*
The MIT License (MIT)
Copyright (c) 2016 by António Sarmento
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is