Skip to content

Instantly share code, notes, and snippets.

View jsdmultisys's full-sized avatar
🐶
who let the dogs out! woof woof!

Jeff Simons Decena jsdmultisys

🐶
who let the dogs out! woof woof!
View GitHub Profile
@jsdmultisys
jsdmultisys / transaction.php
Last active March 26, 2019 07:04
Transaction Test
<?php
/** @test */
public function it_can_create_a_booking_transaction()
{
$service = factory(DeliveryService::class)->create();
$sender = factory(CustomerAccount::class)->create();
$senderAddress = factory(CustomerAddress::class)->create([
'customer_account_id' => $sender->id
/** @test */
public function it_should_reject_payment_under_maybank_if_payment_is_rejected()
{
$this->withoutEvents();
factory(InstitutionPaymentCategory::class)->create();
factory(Institution::class)->create();
factory(PaymentChannelCategory::class)->create();
factory(Collection::class)->create(['status' => 'P']);
$cardTransData = factory(TransactionCard::class)->create([
'checkout_token' => 'ZX8EQAKLGB8DQOLQIDGD',
@jsdmultisys
jsdmultisys / breadcrumb.js
Last active January 6, 2020 07:51
breadcrumb
const string = '/home/about';
const stripped = string.split('/);
// ["", "home", "about"]
// 0 => '', 1 => 'home', 2 => 'about'
const index = stripped.length - 1
stripped[index]
// 'about', it should be 'home'
// this is because total length is 3
@jsdmultisys
jsdmultisys / password.js
Created March 5, 2020 04:09
password creation
```
async register ({ request, response, transform, auth }) {
const validation = await validate(request.only(Retailer.validateFields), Retailer.rules, Retailer.messages)
if (validation.fails()) {
return response.status(422).json({errors: validation.messages()})
}
@jsdmultisys
jsdmultisys / retailer.js
Last active April 20, 2020 04:35
List all retailers
const retailers = await Retailer.all()
if(!retailer) {
throw YourCustomerErrorClass('your-message')
}
return response.json({data: retailers})
// Dockerfile
#-/ Supervisor.
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ENTRYPOINT ["supervisord"]
CMD ["-c", "/etc/supervisor/conf.d/supervisord.conf"]
# Supervisor. /-#
FROM php:7.3-fpm-alpine
# Install dev dependencies
RUN apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
curl-dev \
imagemagick-dev \
libjpeg-turbo \
libjpeg-turbo-dev \
libjpeg \
@jsdmultisys
jsdmultisys / error
Created July 12, 2020 16:32
Error when pushing images
jsdecena@jsdecena-linux dms-retailer-ws (master) $ docker tag dms/retailer-svc:master harbor.hcp.intra.smart/dms/retailer-svc:master
jsdecena@jsdecena-linux dms-retailer-ws (master) $ docker push harbor.hcp.intra.smart/dms/retailer-svc:master
The push refers to repository [harbor.hcp.intra.smart/dms/retailer-svc]
Get https://harbor.hcp.intra.smart/v2/: dial tcp: lookup harbor.hcp.intra.smart on 192.168.1.254:53: no such host
@jsdmultisys
jsdmultisys / evc-service.php
Last active February 27, 2021 23:47
refactor-evc-service
<?php
// ============================== BEFORE ===========================================================
/**
* @param string $mobile
* @param string|null $refId
* @param string|null $type
* @return array