Skip to content

Instantly share code, notes, and snippets.

View Preciousomonze's full-sized avatar
🤡
Coding on the bicycle 😎🚴🏽‍♂️

Precious Omonzejele Preciousomonze

🤡
Coding on the bicycle 😎🚴🏽‍♂️
View GitHub Profile
@Preciousomonze
Preciousomonze / css.css
Last active October 20, 2024 21:05
onboarding
@import url("https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,100..900;1,100..900&display=swap");
.teamsynerg-getting-started-guide {
position: absolute;
display: block;
top: 0;
z-index: 99999999;
width: 100%;
height: 100%;
@Preciousomonze
Preciousomonze / hooks.php
Created October 15, 2024 08:09
Korapay gateway for WooCommerce Mini docu
if ( ! function_exists( 'WC_KORAPAY\\display_proper_error' ) ) {
/**
* Display messages properly.
*
* Incase of debugging
*
* @param array $response
* @param array $kora_params
* @param int $order_id
*/
@Preciousomonze
Preciousomonze / css.css
Last active September 25, 2024 15:40
Tai-Bioptrics css
/* TAI Team style start */
.pum-theme-default-theme {
background-color: rgba( 0, 0, 0, 0.4 );
}
.pum-content + .pum-close, .pum-theme-default-theme .pum-content + .pum-close {
border-radius: 0 0 0 10px;
background-color: #a0cf4f;
}
@Preciousomonze
Preciousomonze / update.php
Last active August 8, 2023 06:00 — forked from adejorosam/gist:db0e015acb85e58c20eeaaded49a11fa
Extended code to help calculate Marginal interest and overdraft for Nigeria stock exchange.
<?php
$jsonData = '{
"data": [
{
"ValueDate": "7/3/2023 12:00:00 AM",
"Description": "Opening Balance",
"Debit": "0.0000",
"Credit": "5905.1135",
"Label": "credit",
@Preciousomonze
Preciousomonze / extra.html
Last active June 24, 2023 13:15
Adding plus and minus to the input quantity field
<div class="pekky-stm-quantity">
<div class="pekky-stm-minus fff"><a class="pekky-stm-btn-change" href="#" data-multi="-1">-</a></div>
<div class="pekky-stm-input">
<input type="number" class="stm_quantity_input" value="1" />
</div>
<div class="spekky-stm-plus fff"><a class="pekky-stm-btn-change" href="#" data-multi="1">+</a></div>
</div>
@Preciousomonze
Preciousomonze / Test_With_Method_injector.php
Last active May 22, 2023 17:48
Trying to use Containers in a WP way
<?php
/**
* Main Plugin
* @version 1.0.0
*/
namespace Backcourt;
use Backcourt\Vendor\League\Container\Container as Container;
use Backcourt\Vendor\League\Container\Definition\Definition as BaseDefinition;
@Preciousomonze
Preciousomonze / file.php
Created March 21, 2023 14:37
Snippet to log errors in wp functions, also valid for php
###
function pekky_var_error_log( $object=null ){
ob_start(); // start buffer capture
var_dump( $object ); // dump the values
$contents = ob_get_contents(); // put the buffer into a variable
ob_end_clean(); // end capture
error_log( $contents ); // log contents of the result of var_dump( $object )
}
############
@Preciousomonze
Preciousomonze / file.js
Last active February 21, 2023 16:36
Fix for a site
<script>
jQuery( function($) {
$( document ).on( 'click', '.ld-expand-button', function( event ) {
// Get the clicked element section cover.
let $_ParentEl = $(this).closest( '.ld-item-lesson-item' );
// Check if it's the parent expand all.
if ( $_ParentEl.length < 1 ) { // It's da big one.
let $_Expanded = $( '.ld-item-list .ld-item-list-item-expanded' ); // trigger all.
@Preciousomonze
Preciousomonze / p.js
Last active January 26, 2023 21:41
Basic js to help in a “readmore” scenario for a friend.
jQuery( function($) {
$( document ).on( 'click', '.ola-section-readmore', function( event ) {
event.preventDefault();
console.log("workssss");
// Get the clicked element section cover.
$_ParentEl = $(this).closest( '.ola-section-cover' );
// Now trigger the necessary for the clicked item.
$_ParentEl.find( '.short-d' ).css( 'display', 'none' );
@Preciousomonze
Preciousomonze / pekky-wc-file.php
Created May 9, 2022 14:15
Pre-select WooCommerce first variation option. Copy code and put in your child theme's function.php or anywhere you see fit. Use at your risk, enjoy! I mean, what's life without taking risks? 🚀
<?php
/**
* Pre-selects first variation option.
*
* @param array $args
* return array
*/
function pekky_wc_select_first_variation_option( $args ) {
$args['selected'] = $args['options'][0];
return $args;