Maurice  Larson

Maurice Larson

1594082282

BootstrapVue — Customizing List Groups

To make good looking Vue apps we need to style our components. To make our lives easier we can use components with styles built-in. In this article, we’ll look at how to add list groups.

Disabled Items

We can disable list group items by adding the disabled prop.

For example, we can write:

<template>
  <div id="app">
    <b-list-group>
      <b-list-group-item disabled>foo</b-list-group-item>
      <b-list-group-item>bar</b-list-group-item>
    </b-list-group>
  </div>
</template>
<script>
export default {
  name: "App"
};
</script>

Then we’ll see the first item grayed out.

Actionable List Group Items

We can add the href prop to a list group item.

For example, we can write:

<template>
  <div id="app">
    <b-list-group>
      <b-list-group-item href="http://example.com">foo</b-list-group-item>
      <b-list-group-item href="http://medium.com">bar</b-list-group-item>
    </b-list-group>
  </div>
</template>
<script>
export default {
  name: "App"
};
</script>

#javascript

What is GEEK

Buddha Community

BootstrapVue — Customizing List Groups

Easy Audit: A Symfony Bundle to Log Selective Events

Easy Audit

A Symfony Bundle To Log Selective Events. It is easy to configure and easy to customize for your need.

Note: If you are using Symfony version older than 5.0 you need to use EasyAuditBundle 1.4.x

Install

  1. Add EasyAuditBundle in your composer.json
  2. Enable the Bundle
  3. Create audit_log entity class
  4. Configure config.yml
  5. Update Database Schema

1. Add EasyAuditBundle in your composer.json

Add EasyAuditBundle in your composer.json:

{
    "require": {
        "xiidea/easy-audit": "^2.0"
    }
}

Now tell composer to download the bundle by running the command:

$ php composer.phar update xiidea/easy-audit

Composer will install the bundle to your project's vendor/xiidea directory.

2. Enable the Bundle

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Xiidea\EasyAuditBundle\XiideaEasyAuditBundle(),
    );
}

3. Create audit_log entity class

The XiideaEasyAuditBundle supports Doctrine ORM/MongoDB by default. However, you must provide a concrete AuditLog class. Follow the instructions to set up the class:

4. Configure config.yml

You can find sample config data in Resources/config/config-sample.yml file

# app/config/config.yml
xiidea_easy_audit:
    #resolver: xiidea.easy_audit.default_event_resolver                           #Optional
    #audit_log_class : MyProject\Bundle\MyBundle\Entity\AuditLog                  #Required
    #doctrine_event_resolver : xiidea.easy_audit.default_doctrine_event_resolver  #Optional
    #default_logger : true                                                        #Optional
    
    #user property to use as actor of an event
    #valid value will be any valid property of your user class
    user_property : ~ # or username                            #Optional

    #List of doctrine entity:event you wish to track or set to false to disable logs for doctrine events
    # valid events are = [created, updated, deleted]
    #doctrine_objects :                                              #Optional
    #     MyProject\Bundle\MyBundle\Entity\MyEntity : [created, updated, deleted]
    #     MyProject\Bundle\MyBundle\Entity\MyEntity2 : []

    #List all events you want to track  (Optional from v1.2.1 you can now use subscriber to define it)
    events :                                                   #Optional
        - security.interactive_login

    #List all custom resolver for event
    #custom_resolvers :
    #       security.interactive_login : user.event_resolver
    #       security.authentication.failure : user.event_resolver

    #logger_channel:
    #    xiidea.easy_audit.logger.service: ["info", "debug"]
    #    file.logger: ["!info", "!debug"]

    #Custom Event Resolver Service
services:
    #user.event_resolver:
    #     class: Xiidea\EasyAuditBundle\Resolver\UserEventResolver
    #     calls:
    #        - [ setContainer,[ @service_container ] ]

5. Update Database Schema

As all setup done, now you need to update your database schema. To do so,run the following command from your project directory

$ php app/console doctrine:schema:update --force

Core Concepts

Logger

Logger is the core service which are responsible for persist the event info. You can define as many logger as you like. EasyAudit Bundled with a logger service xiidea.easy_audit.logger.service which is the default logger service. You can easily disable the service by setting default_logger: false in configuration.

Resolver

Resolver is like translator for an event. It used to translate an event to AuditLog entity. EasyAudit bundled with two(2) resolver services xiidea.easy_audit.default_event_resolver, xiidea.easy_audit.default_doctrine_event_resolver. And a custom EventResolver class UserEventResolver to illustrate how the transformation works. You can define as many resolver service as you want and use them to handle different event. Here is the place you can set the severity level for a event. Default level is Psr\Log\LogLevel::INFO. Custom severity levels are not available. EasyAudit supports the logging levels described by PSR-3. These values are present for basic filtering purposes. You can use this value as channel to register different logger to handle different event. If you add any other field to your AuditLog object, this is the place to add those extra information (tags, metadata, etc..)

Channel

It is now possible to register logger for specific channel. channel is refers to log level. you can configure EasyAudit logger services to handle only specific level of event.

Warning - BC Breaking Changes

Since v1.2.2 pre_persist_listener option has been removed. You can use this cookbook to achieve the same functionality

Since v1.2.2 EventResolverInterface been split into EmbeddedEventResolverInterface and EventResolverInterface

Since v1.3.x The new Event object has been adapted. And the signature of EmbeddedEventResolverInterface and EventResolverInterface also changed. Now it expects extra $eventName parameter

Since v1.4.7 EntityEventResolver been refactored to a simplified version, if your code directly depends on older version of the implementation you are advised to copy the content of old implementation from here

Since v2.0 The FosUserBundle Events are removed from UserEventResolver and Event class using Symfony\Contracts\* namespace

Cookbook

Look the cookbook for another interesting things.


Download Details:

Author: xiidea
Source Code: https://github.com/xiidea/EasyAuditBundle

License: MIT license

#symfony #php 

HI Python

HI Python

1640973720

Beyonic API Python Example Using Flask, Django, FastAPI

Beyonic API Python Examples.

The beyonic APIs Docs Reference: https://apidocs.beyonic.com/

Discuss Beyonic API on slack

The Beyonic API is a representational state transfer, REST based application programming interface that lets you extend the Beyonic dashboard features into your application and systems, allowing you to build amazing payment experiences.

With the Beyonic API you can:

  • Receive and send money and prepaid airtime.
  • List currencies and networks supported by the Beyonic API.
  • Check whether a bank is supported by the Beyonic API.
  • View your account transactions history.
  • Add, retrieve, list, and update contacts to your Beyonic account.
  • Use webhooks to send notifications to URLs on your server that when specific events occur in your Beyonic account (e.g. payments).

Getting Help

For usage, general questions, and discussions the best place to go to is Beyhive Slack Community, also feel free to clone and edit this repository to meet your project, application or system requirements.

To start using the Beyonic Python API, you need to start by downloading the Beyonic API official Python client library and setting your secret key.

Install the Beyonic API Python Official client library

>>> pip install beyonic

Setting your secrete key.

To set the secrete key install the python-dotenv modeule, Python-dotenv is a Python module that allows you to specify environment variables in traditional UNIX-like “.env” (dot-env) file within your Python project directory, it helps us work with SECRETS and KEYS without exposing them to the outside world, and keep them safe during development too.

Installing python-dotenv modeule

>>> pip install python-dotenv

Creating a .env file to keep our secrete keys.

>>> touch .env

Inside your .env file specify the Beyonic API Token .

.env file

BEYONIC_ACCESS_KEY = "enter your API "

You will get your API Token by clicking your user name on the bottom left of the left sidebar menu in the Beyonic web portal and selecting ‘Manage my account’ from the dropdown menu. The API Token is shown at the very bottom of the page.

getExamples.py

import os 
import beyonic
from dotenv import load_dotenv 

load_dotenv()

myapi = os.environ['BEYONIC_ACCESS_KEY']

beyonic.api_key = myapi 

# Listing account: Working. 
accounts = beyonic.Account.list() 
print(accounts)


#Listing currencies: Not working yet.
'''
supported_currencies = beyonic.Currency.list()
print(supported_currencies)

Supported currencies are: USD, UGX, KES, BXC, GHS, TZS, RWF, ZMW, MWK, BIF, EUR, XAF, GNF, XOF, XOF
'''

#Listing networks: Not working yet.
"""
networks = beyonic.Network.list()
print(networks)
"""

#Listing transactions: Working. 
transactions = beyonic.Transaction.list()
print(transactions) 

#Listing contact: Working. 
mycontacts = beyonic.Contact.list() 
print(mycontacts) 


#Listing events: Not working yet.
'''
events = beyonic.Event.list()
print(events)

Error: AttributeError: module 'beyonic' has no attribute 'Event'
'''

Docker file

FROM python:3.8-slim-buster

COPY . .

COPY ./requirements.txt ./requirements.txt

WORKDIR .

RUN pip install -r requirements.txt

CMD [ "python3", "getExamples.py" ]

Build docker image called demo

>>> docker build -t bey .

Run docker image called demo

>>>docker run -t -i bey 

Now, I’ll create a Docker compose file to run a Docker container using the Docker image we just created.


version: "3.6"
services:
  app:
    build: .
    command: python getExamples.py
    volumes:
      - .:/pythonBeyonicExamples

Now we are going to run the following command from the same directory where the docker-compose.yml file is located. The docker compose up command will start and run the entire app.


docker compose up

Output

NB: The screenshot below might differ according to your account deatils and your transcations in deatils.

docker compose up preview

To stop the container running on daemon mode use the below command.

docker compose stop

Output

docker compose preview

Contributing to this repository. All contributions, bug reports, bug fixes, enhancements, and ideas are welcome, You can get in touch with me on twitter @HarunMbaabu.

Download Details:
Author: HarunMbaabu
Source Code: https://github.com/HarunMbaabu/BeyonicAPI-Python-Examples
License: 

#api #python #flask #django #fastapi 

rick william

1626849093

MAGENTO 2 MINIMUM ORDER AMOUNT FOR CUSTOMER GROUP

Set a minimum order amount based on customer groups. Magento 2 Minimum Order Amount for Customer Group Extension helps the store owner to set a minimum order amount for better customer experience to encourage customers to purchase more products or buy bulk products from the store.

#magento 2 minimum order amount for customer group #minimum order amount for customer group #magento 2 #minimum order amount for customer group magento 2

rick william

1621318718

Magento 2 minimum order amount for customer group

Cynoinfotech has developed Magento 2 Minimum Order Amount For Customer Group extension that enables restricting minimum order amount at checkout, based on customer groups as mandatory. The extension helps boost a store’s average order size.

#minimum order amount for customer group magento 2 extension #magento 2 minimum order amount for customer group #minimum order amount for customer group #magento 2

Fynzo Survey

Fynzo Survey

1622049211

Fynzo Customer Feedback Software For Cafes, Hotels, Saloons, Spa!

Customer Feedback Tool | Fynzo online customer feedback comes with Android, iOS app. Collect feedback from your customers with tablets or send them feedback links.

Visit page for more information: https://www.fynzo.com/feedback

#CustomerFeedbackSystem
#PowerfulCustomerFeedbackSystem
#freecustomerfeedbacktools
#automatedcustomerfeedbacksystem
#customerfeedbacktools
#customerratingsystem
#Customerfeedbackmanagement

#customer feedback system #powerful customer feedback system #free customer feedback tools #automated customer feedback system #customer feedback tools #customer rating system