Skip to content

Instantly share code, notes, and snippets.

View denisdemaisbr's full-sized avatar

DENIS DOS SANTOS SILVA denisdemaisbr

View GitHub Profile
@denisdemaisbr
denisdemaisbr / Recibo 2084138 - d.txt
Created April 11, 2024 01:40
apurador para o formato recibo `Imperial`
COMPROVANTE DE APOSTA
***
ID APOSTA: ***
EMITIDO EM: 10/04/1111 04:50:43
CPF: ***
PARTICIPANTE: ***
CONCURSO: 3075
DATA SORTEIO: 10/04/1111
HORA SORTEIO: 20:00:00
LI - LOTINHA
@denisdemaisbr
denisdemaisbr / test.argv_lua.c
Created March 30, 2024 11:45
It's show how create a minimal lua interpreter with some features
/*
denis dos santos silva
2024-03-30
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
@denisdemaisbr
denisdemaisbr / array_shuffle.php
Created March 24, 2024 03:06
generate a array shuffle it then print
<?php
$r = range(1,25);
shuffle($r);
echo implode(" ", $r) . PHP_EOL;
@denisdemaisbr
denisdemaisbr / Flutter Clean.md
Created March 8, 2024 18:51 — forked from minhcasi/Flutter Clean.md
These are common issues on Flutter and solutions to fix

Quick Clean Cache

  1. Open android studio Tools->Flutter->Clean
  2. Go to File -> Invalidate Caches / Restart
  3. Or open terminal run "flutter clean"
  4. Remove pubspec.lock
  5. Double check the Flutter SDK Path config correcty - https://tppr.me/qn6dP

Or open the terminal and try this script:

flutter clean
@denisdemaisbr
denisdemaisbr / Android.mk
Created March 4, 2024 04:09 — forked from knighthedspi/Android.mk
Render to screen using FrameBuffer using OpenGL ES 2.0
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := FriengerScreenRecord
LOCAL_SRC_FILES := Log.cpp CustomFrameBuffer.cpp CustomFrameTexture.cpp FriengerScreenRecord.cpp
LOCAL_CFLAGS := -Werror -std=gnu++11
LOCAL_LDLIBS := -llog -lGLESv2
@denisdemaisbr
denisdemaisbr / minctest.js
Created February 14, 2024 11:50
duktape test unit
//
// MINCTEST - Minimal Duktape Test Library
// This is based on minctest.h (https://codeplea.com/minctest)
//
/*
feel to free to improve
you will need implement a module loading OR embed 'all-in-one'
checkout: https://wiki.duktape.org/howtomodules
@denisdemaisbr
denisdemaisbr / strdup.c
Created February 4, 2024 06:36
strdup with memory aligned
// based on original
// https://github.com/clibs/strdup/blob/master/strdup.
#define strdup_check 1
#define strdup_verbose 0
#define strdup_align(x) (((x)+15)&~15) // 3 (4 bytes), 7 (8 bytes), 15 (16 bytes)
static char* strdup_aligned(const char *str) {
int len;
@denisdemaisbr
denisdemaisbr / fsm.c
Created January 21, 2024 16:29 — forked from ankurs/fsm.c
FSM in C
/**
* @file fsm.c
* @brief an implementation for a FSM in C, this file contains
* implementation of definations.
* License GPLv3+
* @author Ankur Shrivastava
*/
#include "fsm.h"
#include<stdlib.h>
@denisdemaisbr
denisdemaisbr / base64_encode.c
Created January 8, 2024 22:44
base64 encode using openssl (c, c99, openssl, base64)
#include <stdlib.h>
#include <openssl/evp.h>
#include <openssl/rand.h>
char* base64_encode(const void *s, int length, int *ret_length) {
BIO *bio = NULL, *b64 = NULL;
BUF_MEM *bufferPtr = NULL;
char *encoded = NULL;
const unsigned char* str = (const unsigned char*) s;
@denisdemaisbr
denisdemaisbr / test.c
Created January 7, 2024 19:12
example with __COUNTER__ macro
/*
https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
*/
#include <stdio.h>
int main(void) {
printf("%d ", __COUNTER__ );
printf("%d ", __COUNTER__ );
printf("%d ", __COUNTER__ );