This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
use Symfony\Component\Uid\UuidV8; | |
class DatedDeterministicUuid extends UuidV8 | |
{ | |
public function __construct(\DateTimeInterface $date, mixed $value) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Rekalogika\Util; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\Common\Collections\Collection; | |
/** | |
* Make an object read only by recursively only allowing get*, is*, has* | |
* methods, and specifically for Doctrine Collection: contains, containsKey, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
A simple script to calculate the beginning of month | |
in the Hijri calendar. For educational purposes only. | |
''' | |
import ephem | |
from datetime import datetime, timedelta | |
# start and end time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
lunar-eclipse-prediction.py | |
Original: https://github.com/flatearthws/eclipse-calculations/blob/master/lunar-eclipse-prediction.py | |
Shows the occurences of a lunar eclipse in the 21st century. | |
Works by iterating every hour in the 21st century and calculating if the | |
separation between the Moon and the Sun is more than 180°-0.9° (= 179.1°). | |
The number 0.9° is hardcoded for simplicity, for more accuracy, it | |
should be computed from the distance of the Moon and the Sun. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
Script sederhana hisab bulan baru hijriah. | |
Mungkin tidak 100% akurat. | |
Perlu pyephem (pip install ephem). | |
''' | |
import ephem | |
from datetime import datetime, timedelta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# inspired from https://askubuntu.com/questions/160945/is-there-a-way-to-disable-a-laptops-internal-keyboard | |
KEYBOARD="AT Translated Set 2 keyboard" | |
MOUSE="TPPS/2 IBM TrackPoint" | |
KEYBOARDMASTER="Virtual core keyboard" | |
MOUSEMASTER="Virtual core pointer" | |
ICON=~/bin/keyboard-on.png |