Skip to content

Instantly share code, notes, and snippets.

View isu3ru's full-sized avatar

Isuru Ranawaka isu3ru

  • Sri Lanka
  • 11:06 (UTC +05:30)
View GitHub Profile
WidgetsFlutterBinding.ensureInitialized();
// more code in here
await SystemChrome.setPreferredOrientations(
<DeviceOrientation>[
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
],
).then(
@isu3ru
isu3ru / UUIDable.php
Created July 9, 2022 15:57
UUID as primary key in Laravel Eloquent Models
<?php
namespace App\Traits;
use Illuminate\Support\Str;
trait UUIDable
{
/**
var initGrnDetailsViewDataTable = function() {
$('#grn_list_table').DataTable({
ajax: {
url: base_url + 'grn/ajax_getGrnListDatatableData',
dataSrc: 'data'
},
columns: [
{ data: 'index' },
{ data: 'id' },
import java.util.*;
public class Atm {
public static void main(String arg[]) {
int pasward = 1234;
double amount = 5674.25;
Scanner sc = new Scanner(System.in);
System.out.println("\tWelcome To ABC Bank");
import java.util.*;
public class AskPass {
public static void main(String[] args) {
int password = 1234;
double amount = 5674.25;
Scanner sc = new Scanner(System.in);
System.out.print("Enter your PIN number : ");
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>First Page</title>
<style>
#wrapper {
width: 960px;
margin: 0px auto;
@isu3ru
isu3ru / PasswordGenerate.js
Created November 17, 2020 12:04
Simple function to generate a random text that can be used as a password in most cases
/**
* Generate Password Function
* A simple javascript function to generate a random text that can be used as a password in most cases
* NOTES: Does not contain special characters. Only numbers 0 (zero) to 9 (Nine) and English alphabet letters.
*
* @author Isuru Ranawaka ([email protected])
*/
function generatePassword() {
// Numbers and alphabet characters
const characters = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "]", "^", "_", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ceytechmarker.docx;
import java.util.HashMap;
import java.util.Scanner;
<?php
public function getNextDays($day = 'Tue', $count = '+2', $type = 'months') {
// current date
$today = date('Y-m-d');
// add 2 months to date
$twoMonthsLater = date('Y-m-d', strtotime(sprintf('%s %s', $count, $type)));
// set begin date of the range (today or any other date)
$begin = new \DateTime($today);
#go to the conf folder
cd /etc/apache2/sites-available
#create the new .conf file
sudo vi myapp.com.conf
#Add the following content to your .conf file
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName myapp.com