Skip to content

Instantly share code, notes, and snippets.

View Super-Chama's full-sized avatar
🍊
Back to office

Chamara Abesinghe Super-Chama

🍊
Back to office
View GitHub Profile

Check latest changes
git fetch upstream

Switch to latest 5.2 branch
git checkout upstream/5.2

Create and switch to your local branch
replace [JIRA_ID] with your ticket ID
git checkout -b [JIRA_ID]

// Based on a field value, show some extra input fields
const schemaOne = {
layout: [
{
type: 'grid',
props: {
cols: 2,
},
children: {

Date format in OHRM Application

Date format for the application can be configured within Admin - Localisation screen via a Admin user. this format is universal for the application and once changed all places should be updated. This format is only used for the display purposes and all the communication between BE/FE via API is carried out via single date format that is not user changeable. (Hence the distinction display format and io format)

Difference between BE/FE date format.

The tokens (symbols) that is used between PHP and JavaScript languages are different when using date format.

Consider date with format 2022-05-11 (Year-month-date)

  • PHP Format - Y-m-d
import {ConcreteComponent, CSSProperties} from 'vue';
export const TYPE_BUTTON = 'button';
export const TYPE_INPUT = 'input';
export const TYPE_FILE_INPUT = 'file';
export const TYPE_TEXTAREA = 'textarea';
export const TYPE_DROPDOWN = 'dropdown';
export const TYPE_PASSWORD = 'password';
export const TYPE_CHECKBOX = 'checkbox';
export const TYPE_SWITCH = 'switch';
import {ConcreteComponent, CSSProperties} from 'vue';
export const TYPE_BUTTON = 'button';
export const TYPE_INPUT = 'input';
export const TYPE_FILE_INPUT = 'file';
export const TYPE_TEXTAREA = 'textarea';
export const TYPE_DROPDOWN = 'dropdown';
export const TYPE_PASSWORD = 'password';
export const TYPE_CHECKBOX = 'checkbox';
export const TYPE_SWITCH = 'switch';
@Super-Chama
Super-Chama / fixup.sh
Created November 12, 2021 13:58
GIT !fixup
git commit --fixup=HASH
git rebase -i --autosquash HASH^
git push -f origin BRANCH
@Super-Chama
Super-Chama / debain.motd
Last active June 26, 2022 02:14 — forked from rojenzaman/dynmotd
RHEL (Centos/Fedora) dynamic motd
#!/bin/bash
# config
USER=`whoami`
HOSTNAME=`uname -n`
ROOT=`df -Ph / | grep / | awk '{print $4}' | tr -d '\n'`
HOME=`df -Ph | grep home | awk '{print $4}' | tr -d '\n'`
BACKUP=`df -Ph | grep backup | awk '{print $4}' | tr -d '\n'`
MNT=`df -Ph | grep mnt | awk '{print $4}' | tr -d '\n'`
@Super-Chama
Super-Chama / info.sh
Created September 9, 2020 17:08
Get Device Battery & Temps over SSH In an Android chroot environment.
#!/bin/bash
dt=`date +"%Y-%m-%d %T"`
bCap=`cat /sys/class/power_supply/battery/capacity`
bTemp=`cat /sys/class/power_supply/battery/temp`
bStatus=`cat /sys/class/power_supply/battery/status`
bHealth=`cat /sys/class/power_supply/battery/health`
cTemp=`cat /sys/class/thermal/thermal_zone10/temp`
echo $cap
@Super-Chama
Super-Chama / functions.php
Created April 18, 2019 15:01
WooCommerce - How to Remove a Shipping Method from Checkout
add_filter('woocommerce_package_rates', 'hide_shipping_method', 100, 2);
function hide_shipping_method($rates, $package){
// Additional conditions can be set
unset( $rates['local_pickup:12']); // This can be any shipping method, you'll have to use browser tools to see the name
return $rates;
}
@Super-Chama
Super-Chama / simple_fizzbuzz.js
Created January 26, 2019 19:00
Just tried a fizzbuzz. i guess i pass.
function fizzBuzz() {
var number = 1;
for (var i = 0; i < 100; i++) {
var bool = true;
if (number%3 ===0 && number%5 !==0){
console.log('fizz');
bool = false;
}