This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| Pusedo Code: | |
| --> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Coding Arena</title> | |
| <link href="https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700" rel="stylesheet"> | |
| <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'learndash_usermeta_shortcode_field_value_display', 'ee_learndash_usermeta_shortcode_field_value_display_callback', 10, 2 ); | |
| function ee_learndash_usermeta_shortcode_field_value_display_callback( $value, $attr ) { | |
| global $post; | |
| // Don't apply logic if not on a certificate | |
| if ( isset( $post->post_type ) ) { | |
| $is_certificate_page = $post->post_type; | |
| if ( 'sfwd-certificates' != $is_certificate_page ) { | |
| return $value; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Psudeo Code: | |
| 1. Media content class with properties title, release date and a method | |
| to display info about the title and release date | |
| 2. Movies should contain genre and display additionally | |
| 3. Tv shows should contain num of seasons and display additionally | |
| --> | |
| <?php | |
| class Media_Content { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Password_Manager { | |
| private $length; | |
| private $useUppercase; | |
| private $useLowercase; | |
| private $useDigits; | |
| private $useSpecialChars; | |
| private $password; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $contact_info = array( | |
| 'Zeeshan ' => ' 03332490820', | |
| 'Bilal ' => ' 03332490895', | |
| ' Danish ' => ' 03332490673', | |
| 'Sami' => ' 03332490165', | |
| 'Ahmed' => ' 03332490090', | |
| ' Batool ' => ' 03332490554', | |
| 'Owais ' => ' 03332490967', | |
| 'Ahsan ' => ' 03332490534', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| session_start(); | |
| // Check if the target number and attempts are set in the session | |
| if (!isset($_SESSION['target_number'])) { | |
| // Generate a random number between 1 and 10 if it's not set | |
| $_SESSION['target_number'] = rand(1, 10); | |
| $_SESSION['attempts'] = 0; | |
| $_SESSION['previous_attempts'] = array(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Minesweeper Game</title> | |
| <style> | |
| body { | |
| text-align: center; | |
| } | |
| .cell { | |
| width: 30px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function get_random_quotes() { | |
| $api_url = 'https://api.quotable.io/random'; | |
| $response = @file_get_contents( $api_url ); | |
| $error = error_get_last(); | |
| if ( $error ) { | |
| echo 'no quotes available at the moment'; | |
| } else { | |
| $quotes_output = json_decode( $response, true ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function generatePassword( | |
| $length, | |
| $useUppercase, | |
| $useLowercase, | |
| $useDigits, | |
| $useSpecialChars | |
| ) { | |
| $formats = [ | |
| "uppercase" => "ABCDEFGHIJKLMNOPQRSTUVWXYZ", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Canvas is a powerful open-source LMS that can be self-hosted on your own server. This is a detailed guide to help you Install Canvas LMS on Ubuntu using the Apache web server and enabling SSL for secure communication. Let's get started! | |
| Caution: Before proceeding, make sure you have administrative access to your Ubuntu server by running "sudo su" and have basic knowledge of command-line operations. Canvas requires Ubuntu 20.04 LTS and a server with at least 8GB RAM. The steps below are quite technical and require a server administrator. | |
| If it's technically challenging for you, allow us to help you set up with our Canvas Installation Service. | |
| Step 1: Create a PostgreSQL user and databases for Canvas | |
| Once you execute this command, it will ask for your server password and then, your canvas PostgreSQL password. Please note the later one as it will be used when we will edit the canvas database config file. | |
| sudo apt-get install postgresql-12; sudo -u postgres createuser canvas --no-createdb --no-superuser --no- |