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 characters
| // sample | |
| public static void SetProperty(object obj, string propertyName, object value) | |
| { | |
| var prop = obj.GetType().GetProperty(propertyName); | |
| if (prop != null && prop.CanWrite) | |
| { | |
| prop.SetValue(obj, value); | |
| } | |
| } |
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 characters
| -- setup | |
| -- 1. (Optional) Clean up if already exists | |
| IF EXISTS (SELECT 1 FROM sys.server_audit_specifications WHERE name = 'TrackAllLogins') | |
| BEGIN | |
| ALTER SERVER AUDIT SPECIFICATION TrackAllLogins WITH (STATE = OFF); | |
| DROP SERVER AUDIT SPECIFICATION TrackAllLogins; | |
| END | |
| GO |
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 characters
| composer dump-autoload -o |
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 characters
| use DB | |
| go | |
| ALTER TABLE Tbl_SysUserIssueCategory | |
| ADD CONSTRAINT UQ_SysUser_IssueCategory UNIQUE (SysUserId, IssueCategoryId); | |
| remove | |
| ======= | |
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 characters
| -- current id 1, 2, 3, 4 so reseed is 4 next is 5 | |
| DBCC CHECKIDENT ('Comment', RESEED, 4); |
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 characters
| composer require simplesoftwareio/simple-qrcode "~4" --with-all-dependencies | |
| enable php.ini file => extension=gd | |
| used in laravel blade file | |
| {!! QrCode::size(250)->generate('mailto:SampathPerera@hotmail.com'); !!} |
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 characters
| using TelegramBot.Helpers; | |
| Console.WriteLine("Sending Start..."); | |
| DateTime startTime = DateTime.Now; | |
| Console.Write("Type your Message: "); | |
| string message = Console.ReadLine()!; | |
| await TelegramBotHandler.SendTelegramMessage(message!); | |
| DateTime endTime = DateTime.Now; |
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 characters
| eg. string start = "20250101" | |
| DateTime startDate = DateTime.ParseExact(start, "yyyyMMdd", CultureInfo.InvariantCulture); |
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 characters
| Note: change memory limit in : /home/smedb/public_html/wp-includes/default-constants.php | |
| line 52: 40M to 256M |
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 characters
| if ("geolocation" in navigator) { | |
| // Geolocation is supported | |
| navigator.geolocation.getCurrentPosition( | |
| (position) => { | |
| // Success callback | |
| const latitude = position.coords.latitude; | |
| const longitude = position.coords.longitude; | |
| console.log(`Latitude: ${latitude}, Longitude: ${longitude}`); | |
| }, | |
| (error) => { |
NewerOlder