Skip to content

Instantly share code, notes, and snippets.

View tembleking's full-sized avatar
🏠
Working from home

Fede Barcelona tembleking

🏠
Working from home
View GitHub Profile
@tembleking
tembleking / main.go
Created October 4, 2018 21:06
Prometheus Golang Example
package main
import (
"fmt"
"log"
"math/rand"
"net/http"
"time"
"github.com/prometheus/client_golang/prometheus"
@tembleking
tembleking / app.js
Created October 4, 2018 21:04
Prometheus Node.js Example
const client = require('prom-client');
const express = require('express');
const server = express();
const register = new client.Registry();
// Probe every 5th second.
const intervalCollector = client.collectDefaultMetrics({prefix: 'node_', timeout: 5000, register});
const counter = new client.Counter({
name: "node_my_counter",
@tembleking
tembleking / app.js
Created September 28, 2018 06:11
Prometheus
const client = require('prom-client');
const express = require('express');
const server = express();
const register = new client.Registry();
// Probe every 5th second.
const intervalCollector = client.collectDefaultMetrics({prefix: 'node_', timeout: 5000, register});
const counter = new client.Counter({
name: "node_my_counter",
@tembleking
tembleking / chan.hpp
Created August 18, 2018 16:15
Simple C++ implementation of Golang channels
/*
The MIT License (MIT)
Copyright (c) 2018 Federico Barcelona <[email protected]>
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 furnished to do so, subject to the following conditions:
@tembleking
tembleking / ExamenFuncionesC.c
Created March 11, 2014 11:57
Examen de funciones en C [28/01/2014]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//! @author Federico Barcelona
//! @date 28/01/2014
//!////////////////////////// BLOQUE 1 ////////////////////////////////////
//! Ejercicio 1 ///////////////////////////////////////////////////////////////
int multiplos(int num1, int num2)
{
if (num1 % num2 == 0)
@tembleking
tembleking / Aula.java
Created March 11, 2014 11:54
Examen Java 1hCFGS [28/02/2014]
public class Aula {
private Equipo[] equipos;
private String nombreAula;
public Aula(String nombreAula, Equipo[] equipos)
{
this.nombreAula = nombreAula;
this.equipos = new Equipo[20];
try
{