Skip to content

Instantly share code, notes, and snippets.

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

Túlio Paim tuliopaim

🏠
Working from home
View GitHub Profile
@tuliopaim
tuliopaim / dotnet-test.lua
Created November 6, 2023 23:00
lua functions to run dotnet test for the whole file and for the test under the cursor
local M = {}
M.get_class_name = function()
return vim.fn.expand('%:t:r')
end
function M.get_node_text(node, bufnr)
bufnr = bufnr or vim.api.nvim_get_current_buf()
local start_row, start_col, _, end_col = node:range()
local line = vim.api.nvim_buf_get_lines(bufnr, start_row, start_row + 1, false)[1]
@tuliopaim
tuliopaim / docker-compose.yaml
Created September 16, 2021 15:33 — forked from alexandrebl/docker-compose.yaml
Kafka And Zookeeper Docker Compose
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
networks:
- net
ports:
- 2181:2181
environment:
@tuliopaim
tuliopaim / AgruparPorPropriedade.js
Last active November 26, 2020 02:43
Função para agrupar uma lista em multiplas listas por propriedade, similar ao .GroupBy() do Linq no C#
function AgruparPorPropriedade(arr, propName) {
var group = [];
arr.forEach(item => {
if (!group[item[propName]])
group[item[propName]] = arr.filter(i => i[propName] === item[propName]);
});
return group;
}
@tuliopaim
tuliopaim / Tree.cs
Last active March 23, 2021 15:52
Simple Char Tree in C#
using System;
using System.Collections.Generic;
using System.Text;
namespace TestingConsole
{
public class Node
{
private int Level { get; set; }
private List<Node> Children { get; set; }
@tuliopaim
tuliopaim / displace.c
Created July 6, 2018 12:42
SB lab22 ex3
#include <stdio.h>
typedef int (*FuncPtr)(int);
unsigned char codigo[] = {
0x55,
0x48, 0x89, 0xe5,
0x48, 0x83, 0xec, 0x10,
0x89, 0x7d, 0xfc,
0x8b, 0x45, 0xfc,
#include <stdio.h>
#include <math.h>
void mult2(int a[], double b[], int n);
void mult3(int a[], double b[], int n) {
int *pint;
double *pdouble;
for (pint = a, pdouble = b; n-- ; pint++, pdouble++) {
*pdouble = (double)*pint * 2.0;
@tuliopaim
tuliopaim / lab18-ex3.s
Created June 19, 2018 11:36
Ex3 lab18 SB
.text
.global calc3
calc3:
pushq %rbp
movq %rsp, %rbp
subq $16, %rsp
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
@tuliopaim
tuliopaim / locadora.sql
Created June 12, 2018 14:39
ex-17 banco de dados
drop database locadora;
create database locadora;
use locadora
create table locadora(
cgc int not null,
nome varchar(30) not null
);
create table cliente(
#include <stdio.h>
#include <stdlib.h>
#define makefloat(s,e,f) ((s & 1)<<31 | (((e) & 0xff) << 23) | ((f) & 0x7fffff))
#define getsig(x) ((x)>>31 & 1)
#define getexp(x) ((x)>>23 & 0xff)
#define getfrac(x) ((x) & 0x7fffff)
typedef union {
float f;
.data
CARNE: .word 1
LEITE: .word 2
OVO: .word 3
LEN: .int 3
.align 8
Produto:
/*produtos[0]*/
.word 0 /* +0 short produto*/