Skip to content

Instantly share code, notes, and snippets.

View Plankiton's full-sized avatar
💩
...

Yaks Souza Plankiton

💩
...
View GitHub Profile
--[[
lvim is the global options object
Linters should be
filled in as strings with either
a global executable or a path to
an executable
]]
-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
@Plankiton
Plankiton / fabilogo.svg
Created January 6, 2023 20:28
Logo fabiana
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// Tabuleiro
int board[50], down[4], up[4];
// Jogadores
int play[2];
@Plankiton
Plankiton / aws.yml
Created January 10, 2022 22:29
AWS Actions
name: Deploy to Amazon ECS
on:
push:
- main
- develop
pull_request:
- main
- develop
release:
@Plankiton
Plankiton / setting_struct_field_dinamicaly.go
Created January 7, 2022 18:43
Setting Struct Field Dinamicaly Using Go
package main
import (
"fmt"
"reflect"
)
type Config struct {
A string `default:"joao"`
B string `default:"maria"`

Example: golang gorm postgres uuid relation

I was trying forever to get autoloading relationships working with postgres 9.4 and gorm and primary keys of type uuid.

Many tutorials and examples, even those on the official docs were just not workiong or missing important details.

The program in this gist creates the table structure and inserts a nested record. A parent and a child object is created by simply creating the child, which holds the relation to a parent. The child element then is queried by ID. The returned object holds the nested parent object.

Used package versions:

@Plankiton
Plankiton / index.html
Last active November 27, 2021 13:47
Donut math js implementation
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Donut</title> <style>::selection{background: #505050}::-moz-selection{background: #505050}.container, body, html{overflow: hidden; background-color: #000; height: 100%}.container{color: #fff; display: -webkit-flexbox; display: -ms-flexbox; display: flex; -webkit-flex-align: center; -ms-flex-align: center; align-items: center; justify-content: center}</style> </head> <body> <div class="container"> <pre class="center" id="d"></pre> </div><script>parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);
@Plankiton
Plankiton / array_union.c
Last active August 4, 2021 14:29
Thats algorithm make a union between 2 int8 arrays without to repeat values
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
bool contains(char l, char * v, char c);
char * do_union(char n1, char n2, char * v1, char * v2);
int main()
{
char n1, n2;
printf("type length of array 1 and array 2:\n ex: 2 3 ");