Skip to content

Instantly share code, notes, and snippets.

View fbarrios's full-sized avatar

Federico Barrios fbarrios

View GitHub Profile
@fbarrios
fbarrios / latency.py
Created August 19, 2018 15:55
Small script to test the latency of DigitalOcean servers by downloading a 10MB sample file from each.
import urllib.request
import time
# Small script to test the latency of DigitalOcean servers by downloading
# a 10MB sample file from each.
REQ_FORMAT = "http://speedtest-{r}.digitalocean.com/10mb.test"
ZONES = {
'nyc1', 'nyc2', 'nyc3',
#include <time.h>
#include <stdlib.h>
...
static void swap(void* array[], size_t p1, size_t p2)
{
void* temp = array[p1];
array[p1] = array[p2];
array[p2] = temp;
@fbarrios
fbarrios / return.c
Created May 14, 2017 17:44
Dos formas de devolver un valor en C
// Forma #1: por valor de retorno
int obtener_valor()
{
return 4;
}
int main()
{
int x = obtener_valor();
// Uso el valor de x.
// test.c
#include<stdio.h>
int main()
{
size_t num = 100;
char cadena[10];
sprintf(cadena, "%zd", num);
printf("%s\n", cadena);
#%RAML 1.0 Library
---
usage: |
This library defines annotation types to provide connectivity using the REST-Connect toolkit.
annotationTypes:
ignored:
type: string?
description: |
This annotation allows to specify a method which will not be transformed into an operation.
@fbarrios
fbarrios / settings.xml
Last active November 18, 2016 17:46
Maven Log4j config
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.7</version>
</dependency>