Skip to content

Instantly share code, notes, and snippets.

View KasunDA's full-sized avatar

Касун Д.А KasunDA

  • Colombo,Sri Lanka
View GitHub Profile
@KasunDA
KasunDA / timezone-list.php
Created December 22, 2024 19:53 — forked from blacksmoke26/timezone-list.php
List of timezones (PHP)
<?php
$listOfTimeZones = [
'Africa'=> [
'Africa/Algiers'=>'Algeria (+01:00)',
'Africa/Gaborone'=>'Botswana (+02:00)',
'Africa/Douala'=>'Cameroon (+01:00)',
'Africa/Bangui'=>'Central African Republic (+01:00)',
'Africa/Ndjamena'=>'Chad (+01:00)',
'Africa/Kinshasa'=>'Democratic Republic of the Congo (+01:00)',
@KasunDA
KasunDA / CountryCodes.json
Created May 12, 2023 03:31 — forked from anubhavshrimal/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@KasunDA
KasunDA / encryption.js
Created September 6, 2022 06:14 — forked from vlucas/encryption.ts
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@KasunDA
KasunDA / session_example_config.php
Created December 28, 2018 17:38 — forked from HoangPV/session_example_config.php
PHP MySQL Login System
<?php
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'Hoang123');
define('DB_NAME', 'session_example');
define('DB_SERVER', 'localhost');
/* Attempt to connect to MySQL database */
/** @var mysqli $mysqli */
$mysqli = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
@KasunDA
KasunDA / laravellocal.md
Created October 26, 2018 05:06 — forked from hootlex/laravellocal.md
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci