Skip to content

Instantly share code, notes, and snippets.

View chrisianfaith's full-sized avatar
💭
I may be slow to respond.

ChristianFaith chrisianfaith

💭
I may be slow to respond.
View GitHub Profile
@chrisianfaith
chrisianfaith / gist:1b691b6bcdce091799e1e8dc35fc094f
Last active July 14, 2023 08:40
Algorithm is a UserList class that provides a data structure that manages a list of users.
#include <iostream>
class User
{
public:
std::string email, password;
User(const std::string &email, const std::string &password)
{
this->email = email;
@chrisianfaith
chrisianfaith / gist:e972efd57d4f0f7df647f9de2d7d2ea2
Last active August 8, 2022 04:32
wp-simple-pay-snippet-library/plugins/add-cache-exclusion.php
<?php
function simpay_custom_add_cache_exclusion( $uris ) {
// Exclude a page such as https://mysite.com/custom-confirmation-page
$uris[] = 'custom-confirmation-page';
return $uris;
}
add_filter( 'simpay_cache_exclusion_uris', 'simpay_custom_add_cache_exclusion' );
@chrisianfaith
chrisianfaith / gist:e23f28cf003fd666475cf3a71a0950bb
Created August 8, 2022 04:14
wp-simple-pay-pro/package.json
{
"name": "wp-simple-pay-lite",
"title": "WP Simple Pay Lite for Stripe",
"description": "Add high conversion Stripe Checkout forms to your WordPress site and start accepting payments in minutes. **Lite Version**",
"version": "4.4.71",
"license": "GPL-2.0-or-later",
"homepage": "https://wpsimplepay.com/",
"repository": {
"type": "git",
"url": "https://github.com/wpsimplepay/wp-simple-pay-lite"
@chrisianfaith
chrisianfaith / gist:4067d0e5418aeb867bc96dcca88436e0
Last active August 8, 2022 04:33
oxygen-save-rendered-content.php
/* Copy compiled Oxygen page content to post_content for search */
function sg_save_rendered_page_content( $meta_id, $object_id, $meta_key, $meta_value ) {
// Debugging
// $debug .= preg_replace( '#(\[/[^\]]+?\])#', "$1\n", $meta_value );
// file_put_contents( plugin_dir_path( __FILE__ ) . 'debug.html', $debug );
if ( 'ct_builder_shortcodes' != $meta_key ) return;
// Don't try to render anything with inner content
if ( false !== strpos( $meta_value, '[ct_inner_content' ) ) return;
https://oxygenbuilder.com/documentation/troubleshooting/troubleshooting-guide/
https://oxygenbuilder.com/documentation/other/rebuilding-live-sites/
wp_ajax_oxygen_vsb_cache_generated
update_option__oxygen_vsb_universal_css_url
update_option__oxygen_vsb_css_files_state
@chrisianfaith
chrisianfaith / function.php
Created June 15, 2021 10:23
Remove Expired course status when user did not start the course and Enable course status from course start.
add_filter('wplms_expired_course_button',function($button,$course_id){
if(is_user_logged_in()){
$user_id = get_current_user_id();
$course_status = bp_course_get_user_course_status($user_id,$course_id);
if($course_status == 0){ //USer subscribed but not started
$init=WPLMS_tips::init();
if(!empty($init->lms_settings['calculate_course_duration_from_start_course'])){
$expiry = bp_course_get_user_expiry_time($user_id,$course_id);
if($expiry &lt; time(){
@chrisianfaith
chrisianfaith / gist:b88deb50d6c3b7411b434267fcaf09b3
Created May 19, 2021 10:09
Hide Assignment durations and timings on our LMS
**//Duration on page assignment
div#unit_content h3.assignment_heading strong:nth-last-of-type(1) span{display: none;}
Assignment page *//
.assignment_details .assignment_duration {display: none;}
@chrisianfaith
chrisianfaith / gist:c182cc4a3a3099bab084b8282634a1d8
Created November 20, 2020 05:54
Demo New Edu not show heading title in single course with eduma version 4.2.9.1 When update theme eduma to version 4.9.2.1 tile of single courses not show like https://prnt.sc/uutuo1 You need add code below to file functions.php of child theme eduma-child-udemy
add_action( 'thim_wrapper_loop_start', 'udemy_heading_title_courses', 6 );
function udemy_heading_title_courses() {
if ( is_singular( 'lp_course' ) ) {
?>
<div class="course-info-top">
<div class="container">
<div class="row">
<div class="course-info-left col-sm-8">
<?php the_title( '<h1 class="entry-title" itemprop="name">', '</h1>' ); ?>
<?php the_excerpt(); ?>
@chrisianfaith
chrisianfaith / gist:030879118bc8b46c4dd51d270ba0bd9b
Created November 4, 2020 05:52
Hide Drive to Student dashboard
add_action( 'bp_actions', 'bp_remove_profile_tabs', 99999 );
function bp_remove_profile_tabs() {
if(!current_user_can('manage_options')){
global $bp;
bp_core_remove_nav_item( 'buddydrive-2' );
}
<table border="1" cellpadding="1" cellspacing="1" style="width:800px">
<tbody>
<tr>
<td style="text-align: center;"><span style="font-size:16px"><span style="font-family:Times New Roman,Times,serif"><strong>1 installment</strong></span></span></td>
<td style="text-align: center;"><span style="font-size:16px"><span style="font-family:Times New Roman,Times,serif"><strong>3 installments</strong></span></span></td>
<td style="text-align: center;"><span style="font-size:16px"><span style="font-family:Times New Roman,Times,serif"><strong>6 installments</strong></span></span></td>
<td style="text-align: center;"><span style="font-size:16px"><span style="font-family:Times New Roman,Times,serif"><strong>12 installments</strong></span></span></td>
</tr>
<tr>
<td>1,499 (upon enrollment)</td>