Skip to content

Instantly share code, notes, and snippets.

@zerohours
zerohours / Rfc3339Test.java
Created November 22, 2023 17:11 — forked from Megaprog/Rfc3339Test.java
RFC3339 parsing by java.time (only parsing is possible)
package rfc3339;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.ResolverStyle;
@zerohours
zerohours / README.md
Created November 11, 2022 15:41 — forked from merlosy/README.md
Paginated list in Typescript (from Content-Range header)

Pagination abstraction layer

  • Define Pagination class
  • Define PaginatedList<T> generic class
  • Utility functions for parsing http response
/*
* log.cpp
*
* Copyright 2013 Julio Cesar Brizuela @zerohours
*
*/
#include <iostream>
#include <log4cpp/Category.hh>
#include <log4cpp/FileAppender.hh>
@zerohours
zerohours / gilipollas.cpp
Created November 12, 2012 19:26
Hay que ser gilipollas para hacer esto
int getRandomize(int randMax)
{
srand ( time(NULL) );
int randNum; = rand() % randMax + 1;
return 2;
}
@zerohours
zerohours / tiempo.py
Created June 4, 2012 17:03
Cálculo del tiempo en ordenar una lista
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tiempo.py
# Cálculo del tiempo de ordenameinto de lista
#
import time
import random
@zerohours
zerohours / gist:1079615
Created July 13, 2011 02:41
Quicksort on Python
def quicksort(datos, primero, ultimo):
i = primero
j = ultimo
pivote = (datos[primero] + datos[ultimo]) / 2
while i < j:
while datos[i] < pivote:
i+=1
while datos[j] > pivote:
j-=1