Skip to content

Instantly share code, notes, and snippets.

View PyaeSoneAungRgn's full-sized avatar

Pyae Sone Aung PyaeSoneAungRgn

View GitHub Profile
$excelDateTime = 45292.29566316;
// Calculate the number of seconds since January 1, 1900 (Excel base date)
$secondsSince1900 = ($excelDateTime - 25569) * 86400;
// Create a DateTime object using the calculated timestamp
$date = new DateTime("@$secondsSince1900");
echo $date->format('Y-m-d H:i:s'); // Output in desired format
@PyaeSoneAungRgn
PyaeSoneAungRgn / keymap.json
Last active October 28, 2024 14:44
Personal Zed Config
[
{
"context": "Workspace",
"bindings": {
"shift shift": "workspace::ToggleBottomDock"
}
},
{
"context": "Editor",
"bindings": {
@PyaeSoneAungRgn
PyaeSoneAungRgn / get-subnet-mask.md
Created October 13, 2023 03:10
Get subnet mask
ip -o -f inet addr show | awk '/scope global/ {print $4}'
@PyaeSoneAungRgn
PyaeSoneAungRgn / sublime-setup.md
Last active February 25, 2023 03:48
My Personal Sublime Setup

Requirements

php-cs-fixer

composer global require friendsofphp/php-cs-fixer

php-cs-fixer --version
@PyaeSoneAungRgn
PyaeSoneAungRgn / php-public-key-encryption.php
Last active October 13, 2022 03:44
PHP public key encryption for large text
<?php
function ssl_encrypt($source, $key)
{
$maxlength = 117;
$output = '';
while($source) {
$input = substr($source, 0, $maxlength);
$source = substr($source, $maxlength);
@PyaeSoneAungRgn
PyaeSoneAungRgn / laravel-folder-permissions.md
Last active May 14, 2024 07:02
Laravel Folder Permissions
@PyaeSoneAungRgn
PyaeSoneAungRgn / gitignore-not-working.md
Last active July 26, 2022 08:56
Gitignore Not Working
@PyaeSoneAungRgn
PyaeSoneAungRgn / install-redis-for-mac.md
Last active July 2, 2022 04:14
Install Redis For Mac

Install phpredis

git clone https://www.github.com/phpredis/phpredis.git
cd phpredis
phpize && ./configure && make && sudo make install

Add extension=redis.so in your php.ini