Skip to content

Instantly share code, notes, and snippets.

View Blair2004's full-sized avatar
🏠
Working from home

Blair Jersyer Blair2004

🏠
Working from home
View GitHub Profile
@Blair2004
Blair2004 / queable.js
Created October 7, 2018 15:51
This help you to run queable promises and stop the execution if one promise reject an error.
function queuePromises({ promises, param, index = 0, total = 0, results = [] }) {
// promisesArray, _item
if( total === 0 ) {
total = promises.length;
}
console.log( `index is ${index}` );
return new Promise( ( resolve, reject ) => {
if( promises[ index ] !== undefined ) {
<?php
$orderBuilder = new OrderReceiptBuilder( 30 ); // where 30 is the order id
$order = $orderBuilder->get();
// Looping Over Products
$order->products->each( function( $product ) {
$product->price;
$product->gross_price;
$product->tax;
$product->total_tax;
@Blair2004
Blair2004 / actions.php
Created January 25, 2020 13:38
create a frontend UI for NexoPOS
<?php
class Actions extends Tendoo_Module {
public function load_frontend()
{
include_once( dirname( __FILE__ ) . '/../file/to/your/controller.php' );
$controller = new YourController;
if ( $this->uri->segment(1) === '' && $this->uri->segment(2) === null ) {
return $controller->index();