Skip to content

Instantly share code, notes, and snippets.

View ftonello's full-sized avatar

Felipe F. Tonello ftonello

View GitHub Profile
@ftonello
ftonello / swap.c
Created December 16, 2016 15:21
swap test
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/time.h>
#include <time.h>
static long long int ts_us()
{
struct timeval tv;
struct timezone tz;
From f376831f690d3907c26acf20f2829c6a83ec8437 Mon Sep 17 00:00:00 2001
From: "Felipe F. Tonello" <eu@felipetonello.com>
Date: Wed, 2 Dec 2015 15:32:47 +0000
Subject: [PATCH] blog: hello-world.c
Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
---
drivers/Kconfig | 2 ++
drivers/Makefile | 1 +
drivers/hello/Kconfig | 5 +++++
@ftonello
ftonello / url-shortner.c
Last active November 3, 2018 14:44
URL shortner implementation in C. This is just an example how it could be implemented. Ideally the lookup table should be pre-generated and not hardcoded.
/**
* Author: Felipe Ferreri Tonello <eu@felipetonello.com>
*
* This url-shortner it only works with ASCII characters. It encodes and
* decodes ids.
* You can change base_x as you wish.
*
* It runs at least 20 times faster then a Python implementation.
*
* $ time python url-shortner.py -s I7