Last active
March 1, 2019 16:17
-
-
Save kubadlo/17d82fe7a069bdc7f68ca8c27b84d38e to your computer and use it in GitHub Desktop.
Revisions
-
kubadlo revised this gist
Mar 1, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ GenerateBirthNum() Random, Gender, 0, 1 Year: Random, Year, 1970, FormatTime, CurrentDateTime,, yyyy ShortYear := Mod(Year, 100) < 10 ? 0 . Mod(Year, 100) : Mod(Year, 100) Month: -
kubadlo revised this gist
Mar 1, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -30,7 +30,8 @@ GenerateBirthNum() Sequence := 0 . Sequence } BirthNumModulo := Mod(ShortYear . Month . Day . Sequence, 11) ControlNumber := BirthNumModulo == 10 ? 0 : BirthNumModulo SendInput % ShortYear . Month . Day . "/" . Sequence . ControlNumber Exit -
kubadlo created this gist
Mar 1, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,57 @@ ; Function to generate birth numbers [Win + Shift + B] #+b::GenerateBirthNum() GenerateBirthNum() { Gender: Random, Gender, 0, 1 Year: Random, Year, 1920, FormatTime, CurrentDateTime,, yyyy ShortYear := Mod(Year, 100) < 10 ? 0 . Mod(Year, 100) : Mod(Year, 100) Month: Random, Month, 1, 12 Month := Gender == 1 ? Month + 50 : Month Month := Month < 10 ? 0 . Month : Month Day: Random, Day, 1, LastDayOfMonth(Month, Year) Day := Day < 10 ? 0 . Day : Day Sequence: Random, Sequence, 0, 999 if (Sequence < 10) { Sequence := 00 . Sequence } else if (Sequence < 100) { Sequence := 0 . Sequence } ControlNumber := Mod(ShortYear . Month . Day . Sequence, 11) SendInput % ShortYear . Month . Day . "/" . Sequence . ControlNumber Exit } LastDayOfMonth(Month, Year) { if (Month == 4 || Month == 6 || Month == 9 || Month == 11) { return 30 } if (Month == 2) { return IsLeapYear(Year) ? 29 : 28 } return 31 } IsLeapYear(Year) { return Mod(Year, 4) == 0 && (Mod(Year, 100) != 0 || Mod(Year, 400) == 0) }