├── apps
│ └── my-app
│ └── composer.json
├── packages
│ └── my-custom-package
│ └── composer.json
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
# Access PostgreSQL: Once PostgreSQL is installed, you can access it using the command-line tool psql. | |
# Open your terminal or command prompt and run: | |
psql -U postgres | |
# Create a Database: To create a new database, you can use the following SQL command inside the psql prompt: | |
CREATE DATABASE yourdbname; | |
# Create a User with a Password: You can create a new user and set a password for that user using the following SQL commands: | |
CREATE USER yourusername WITH PASSWORD 'yourpassword'; |
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
function calculateBusinessDays(startDate, endDate){ | |
// Validate input | |
if (endDate < startDate) | |
return 0; | |
// Calculate days between dates | |
var millisecondsPerDay = 86400 * 1000; // Day in milliseconds | |
startDate.setHours(0,0,0,1); // Start just after midnight | |
endDate.setHours(23,59,59,999); // End just before midnight | |
var diff = endDate - startDate; // Milliseconds between datetime objects |
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
//expected output | |
Current Date | +1 month | |
----------------------------------------------------- | |
2015-01-01 | 2015-02-01 (+31 days) | |
2015-01-15 | 2015-02-15 (+31 days) | |
2015-01-30 | 2015-03-02 (+31 days, skips Feb) | |
2015-01-31 | 2015-03-03 (+31 days, skips Feb) | |
2015-02-15 | 2015-03-15 (+28 days) | |
2015-03-31 | 2015-05-01 (+31 days, skips April) | |
2015-12-31 | 2016-01-31 (+31 days) |
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
old : https://github.com/<username>/<username/project_name.git> | |
new : https://<username>:<personal_token>@github.com/<username/project_name.git> | |
- generate personal token | |
Settings > Developer settings > Personal access tokens | |
git remote set-url origin <url> | |
git remote -v (view remote url) |
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
$('#ic1,#ic2,#ic3').keyup(function(){ | |
/*get value from form*/ | |
var dob = $('#ic1').val(); // eg: 850510 - 10/05/1985 | |
var code = $('#ic2').val(); // eg: 14 - Wilayah Persekutuan | |
var icno = $('#ic3').val(); // eg: 0000 - ic number | |
//check gender using ic number | |
if (icno % 2 == 0){ | |
$('#gender_F').prop("checked", true); | |
} |
- @license
- Multiselect v1
- https://gist.github.com/mazfreelance
- Copyright (c) 2019 MAZ Tech
- Licensed under the MIT license
- @license
- Multiselect v1
- https://gist.github.com/mazfreelance/568f770e45f6c8cc028157e0fe2e38f7
- Copyright (c) 2019 MAZ Tech
- Licensed under the MIT license
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
$.ajax({ | |
url: '../example.php', | |
type: 'post', | |
data: {}, | |
success: function( data, textStatus, jQxhr ){ | |
// console.log(data); | |
var itemID = <?php echo json_encode($item_id); ?>; | |
// console.log(itemID); | |
$.each(data['data'], function(key, value) { | |
$('select#select_item').append($("<option></option>").attr("value",key).text(value)).trigger('change'); |
NewerOlder