Skip to content

Instantly share code, notes, and snippets.

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

Daniel Ribeiro drgomesp

🏠
Working from home
View GitHub Profile
@regiszanandrea
regiszanandrea / dynamodb
Last active February 4, 2021 10:38
DynamoDB 101
Items = rows
Hash Key: Partition Key
Range Key: Sort Key
Primary key:
- Partition key
- Partition key + Sort Key (unique)
LSI (Local Secondary Index): use when partition key is the same of the primary key
@vomnes
vomnes / a-server.go
Last active May 14, 2024 17:09
Minimalist TCP server/client in Go using only syscalls - Select() to handle file descriptors
package main
import (
"fmt"
"log"
"golang.org/x/sys/unix"
)
// https://www.gnu.org/software/libc/manual/html_node/Sockets.html#Sockets
@cbrgm
cbrgm / install-ro.sh
Last active August 9, 2023 01:38
Install rAthena RagnarokOnline Server on Ubuntu 18.04
#!/bin/bash
######################################################
# Basic settings
######################################################
# server base directory
RAGNAROK_DIR=/rAthena
# mysql database settings
MYSQL_ROOT_PW="changeme"
@elfsternberg
elfsternberg / fizzbuzz.rs
Last active February 8, 2021 08:11
Pedantic FizzBuzz implementation in Rust
use std::fmt;
enum FizzBuzzOr {
Fizzbuzz(&'static str),
Or(i32)
}
impl fmt::Display for FizzBuzzOr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use FizzBuzzOr::*;
@cheery
cheery / vulkan_abstraction.md
Last active October 21, 2022 16:14
Vulkan abstraction layer warpgpu ideas

WarpGPU abstractions

Vulkan appears to favor abstractions that are transparent and incremental. Meaning:

  • A new abstraction can be introduced in isolation.
  • Individual pieces in the abstraction layer can be left out or or substituted with a different one.

The following abstractions seem evident after studying

<?php
class Item
{
public $name;
public $parent;
public function __construct($name, Item $parent = null)
{
$this->name = $name;
$this->parent = $parent;
@cezarguimaraes
cezarguimaraes / ioitems.lua
Last active November 2, 2019 00:25
Parse tibia dat files
local vstruct = require 'vstruct'
function Items(path)
local buffer = io.open(path, 'rb')
local signature = vstruct.readvals('u4', buffer)
local itemCount, creatureCount, effectCount, distanceCount = vstruct.readvals('4 * u2', buffer)
local items = {}
<?php
class DesvioPadrao
{
public function media();
public function somaQuadradoDesvio();
public function desvioPadraoPopulacional();
public function desvioPadraoAmostral();
}
@drgomesp
drgomesp / curso-online-symfony.md
Last active August 29, 2015 14:02
Curso online de Symfony

Curso online de Symfony

Formato

O curso será disponibilizado no formato de vídeos – screencasts – através do meu canal pessoal, no YouTube. Os capítulos terão relação entre sí no sentido de que, em capítulos futuros, partirei da premissa de que conceitos já abordados em capítulos anteriores já estão dominados pelo viewer.

Capítulos

@Bolinha1
Bolinha1 / TransformaCsvEmArray.php
Last active August 29, 2015 14:02
Classe que transforma arquivo csv em um array associativo formando um par de chaves e valor usando o cabeçalho como chave.
<?php
namespace Arquivo;
use Exception;
class TransformaCsvEmArray
{
private $arquivo;
private $cabecalho;
public function __construct($arquivo, TransformaCabecalhoCsvEmArray $cabecalho)
{