Skip to content

Instantly share code, notes, and snippets.

View theaungmyatmoe's full-sized avatar
🐙
Real life doesn’t always follow the prim and proper science of a CS classroom.

Aung Myat Moe theaungmyatmoe

🐙
Real life doesn’t always follow the prim and proper science of a CS classroom.
View GitHub Profile
@theaungmyatmoe
theaungmyatmoe / index.cjs
Created April 2, 2024 14:56
Kafka Message Parsing via from service
const {CompressionTypes, CompressionCodecs, Kafka} = require('kafkajs')
const SnappyCodec = require('kafkajs-snappy')
CompressionCodecs[CompressionTypes.Snappy] = SnappyCodec
const kafka = new Kafka({
clientId: 'my-app',
brokers: ['kafka:9092',],
})
@theaungmyatmoe
theaungmyatmoe / paginate.php
Created January 26, 2024 13:30 — forked from vluzrmos/paginate.php
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator
@theaungmyatmoe
theaungmyatmoe / README.md
Created October 6, 2023 06:53
npm ERR! code EACCES
⠙ Installing packages (npm)...npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /Users/admin/.npm/_cacache/index-v5/2d/2a
npm ERR! errno EACCES
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
@theaungmyatmoe
theaungmyatmoe / README.md
Last active September 4, 2023 09:23
Installing mongodb pecl extension in MacOS

mongodb

Install phpize

brew install autoconf

and then export like following if the autoconf is not working.

@theaungmyatmoe
theaungmyatmoe / README.md
Created August 29, 2023 07:45 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@theaungmyatmoe
theaungmyatmoe / README.md
Last active September 5, 2023 08:59
Canvas Scaling Factor calculation base on the image or the parent container

After carefully reviewing and conducting the provided code, I would like to suggest the following improvements:

  1. Code Refactoring and Canvas Responsiveness:

    Start from line 3308:

    answer_canvas.setAttribute(

Running PHP CS Fixer

vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --allow-risky=yes
@theaungmyatmoe
theaungmyatmoe / README.md
Created May 28, 2023 17:10
Fixing laravel passport deps issues
composer require laravel/passport --with-all-dependencies
@theaungmyatmoe
theaungmyatmoe / jwtRS256.sh
Created January 28, 2023 14:05 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub