Skip to content

Instantly share code, notes, and snippets.

View samanthajayasinghe's full-sized avatar
🍊
Focusing

Samantha Jayasinghe samanthajayasinghe

🍊
Focusing
View GitHub Profile
@samanthajayasinghe
samanthajayasinghe / ioncube-check.php
Last active March 2, 2020 07:39
ioncube extension check
<?php
$ioncube_extension = false;
if (!extension_loaded("ionCube Loader")){
$ioncube_extension = true;
}
if($ioncube_extension) {
echo "Ioncube installed";
}else{
echo "Ioncube not installed";
update your ~/.bashrc file following code and that will shows branch name in every git repo
#add git branch name
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@samanthajayasinghe
samanthajayasinghe / orangehrm-git-setup.md
Last active May 30, 2018 10:27
orangehrm-git-setup

How to setup upstream

git remote add upstream git@github.com:orangehrm/orangehrm.git

List git remote set up

git remote -v

it will listed as follows

@samanthajayasinghe
samanthajayasinghe / test-cli.php
Created May 16, 2017 00:43
OrangeHRM api client php example
<?php
require_once 'vendor/autoload.php';
use Orangehrm\API\Client;
use Orangehrm\API\HTTPRequest;
$client = new Client('https://api-sample-cs.orangehrm.com','testclient','testpass');
$request = new HTTPRequest('employee/search');
@samanthajayasinghe
samanthajayasinghe / replace-class-attr.php
Last active May 10, 2017 10:39
Replace class attribute for given html string
<?php
/**
* @param string $htmlString
* @param string $newClassName
* @return string
*/
function formatClassAttribute($htmlString , $newClassName) {
return preg_replace_callback(
'/class="([^"]*)"/i',