Skip to content

Instantly share code, notes, and snippets.

View drajathasan's full-sized avatar

Drajat Hasan drajathasan

View GitHub Profile
@drajathasan
drajathasan / env.php
Created September 14, 2024 23:48
SLiMS Environment config for production
<?php
/**
* Supported mode list:
* - development : all errors will appear
* - production : silent error
*/
$env = 'production';
/**
* Environment mode if
@drajathasan
drajathasan / cf5xx.html
Last active July 9, 2024 07:49
cf5xx.html
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/*! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospa
@drajathasan
drajathasan / cfmc.html
Last active July 9, 2024 07:34
cfmc.html
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/*! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospa
@drajathasan
drajathasan / PluginMaker.php
Created December 30, 2023 07:44
SLiMS Plugin Maker Command
<?php
namespace Commands;
use SLiMS\Cli\Command;
use SLiMS\Filesystems\Storage;
class PluginMaker extends Command
{
/**
* Signature is combination of command name
@drajathasan
drajathasan / PluginMaker.php
Created September 30, 2023 07:52
slims-plugin-maker.console
<?php
namespace Commands;
use SLiMS\Cli\Command;
use SLiMS\Filesystems\Storage;
class PluginMaker extends Command
{
/**
* Signature is combination of command name
version: "3.7"
services:
db8:
image: mysql:8.0.32
container_name: db8
env_file:
- db_default.env
command: --sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION --max_allowed_packet=1024M --log_bin_trust_function_creators=1
volumes:
- "./dbdata8:/var/lib/mysql"
@drajathasan
drajathasan / vscode-ext.list
Last active February 23, 2024 04:39
My Favorite VSCode Extension
code --install-extension CoffeeIO.php-docblocker-coffeeio
code --install-extension edwardhjp.vscode-author-generator
code --install-extension formulahendry.auto-close-tag
code --install-extension adpyke.codesnap
code --install-extension shd101wyy.markdown-preview-enhanced
code --install-extension rangav.vscode-thunder-client
code --install-extension Vue.volar
<!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
<style>
#number > button {
width: 31%;
}
.operator > button {
@drajathasan
drajathasan / OAI PMH SLiMS Reader
Created January 27, 2023 07:15
Consume OAI PMH result in SLiMS
$modsxml = Client::get('https://slims-online/oai2.php?verb=ListRecords&metadataPrefix=oai_dc')->getContent();
$xml = @new SimpleXMLElement($modsxml);
foreach ($xml->ListRecords->record as $record) {
$data = $record->metadata->children('oai_dc', 1)->dc->children('dc', 1);
dump($record->asXML(), $record->metadata->children('oai_dc', 1)->dc->children('dc', 1));
break;
}
exit;
<?php
/**
* Copyright (C) 2009 Arie Nugraha ([email protected])
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,