Skip to content

Instantly share code, notes, and snippets.

@lfmunoz
lfmunoz / Makefile
Created June 4, 2024 05:19
determine number of cyccles for cpu operations
cpu_cycles.elf: cpu_cycles.asm
nasm -f elf64 -g -F dwarf $< -o cpu_cycles.o
# ld -o $@ lfm.o
gcc -no-pie -o $@ cpu_cycles.o
./$@
@lfmunoz
lfmunoz / .config
Created March 13, 2022 23:12
Virtualbox Linux .config for x86_x64
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.16.12 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23700
@lfmunoz
lfmunoz / OurExecutorService.kt
Created July 24, 2020 16:02
Monitor Thread Executor Service
import io.micrometer.core.instrument.Metrics
import io.micrometer.core.instrument.Tags
import com.google.common.util.concurrent.ThreadFactoryBuilder
import java.util.concurrent.ExecutorService
import java.util.concurrent.SynchronousQueue
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit
@Bean(destroyMethod = "shutdown")
fun connectionExecutorService(): ExecutorService {
@lfmunoz
lfmunoz / RabbitPublishBare.kt
Created July 13, 2020 19:00
Rabbit Publisher
package eco.analytics.rabbit
import com.rabbitmq.client.*
import io.vertx.core.json.JsonObject
import io.vertx.rabbitmq.RabbitMQOptions
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.flow
import org.fissore.slf4j.FluentLoggerFactory
@lfmunoz
lfmunoz / RabbitConsumerBare.kt
Created July 9, 2020 03:10
Apache Flink Rabbit Consumer
import com.google.common.io.ByteStreams
import com.rabbitmq.client.*
import org.apache.flink.configuration.Configuration
import org.apache.flink.streaming.api.functions.source.RichParallelSourceFunction
import org.apache.flink.streaming.api.functions.source.SourceFunction
import org.slf4j.LoggerFactory
import java.io.IOException
import java.util.concurrent.CountDownLatch
@lfmunoz
lfmunoz / loggers.html
Last active June 17, 2020 17:24
Spring Boot Logging Configurator based on Jhipster Implementation
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Logging Configuration</title>
<meta name="description" content="">
<style type="text/css">
/** GLOBAL **/
@lfmunoz
lfmunoz / GlobalConfig.kt
Last active September 30, 2019 19:04
RabbitMQ
import com.fasterxml.jackson.databind.ObjectMapper
import org.fissore.slf4j.FluentLoggerFactory
import org.springframework.amqp.rabbit.listener.ListenerContainerConsumerFailedEvent
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.ApplicationListener
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import java.util.concurrent.ExecutorService
import java.util.concurrent.LinkedBlockingQueue
<!-- ________________________________________________________________________________ -->
<!-- HTML -->
<!-- ________________________________________________________________________________ -->
<template>
<div class="container has-text-centered">
<h1 class="title">Account</h1>
<label-text label="UniqueId">{{uniqueId}}</label-text>
<label-text label="Account Balance">
<router-link to="/user/payments">{{amount | currency}}</router-link>
@lfmunoz
lfmunoz / Makefile
Created September 28, 2019 15:53
Frontend Makefile
### Compiles and hot-reloads for development
run:
NODE_ENV="development" npm run serve
prod:
NODE_ENV="production" npm run serve
#NVM_DIR="${XDG_CONFIG_HOME/:-$HOME/.}nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
### Compiles and minifies for production
@lfmunoz
lfmunoz / KotlinUnitTest.kt
Created September 27, 2019 15:18
Kotlin Unit Test Template
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.AfterEach
import io.mockk.clearMocks
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify