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 Robot { | |
private $size; | |
private $color; | |
private $price; | |
function __construct($size, $color, $price) { |
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 | |
$movies = [ | |
'Harry Potter I', | |
'Star Wars V', | |
'One Piece movie', | |
'Titanic', | |
'Frozen III', | |
'Exorcista 2025', | |
]; |
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 | |
$a = 5; | |
$b = 7; | |
$result = $a + $b; | |
checkIfTomorrowWillBeAfatalDay(FALSE); | |
print 'The total of this sum is: ' . $result; |
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 | |
// File: src/Service/CMUArticleMigrationService.php | |
namespace Drupal\cmu_cascade\Service; | |
use Drupal\node\Entity\Node; | |
use Psr\Log\LoggerInterface; | |
/** |
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 | |
// File: src/Commands/CascadeMigrationCommands.php | |
namespace Drupal\custom_migration\Commands; | |
use Drush\Commands\DrushCommands; | |
use Drupal\custom_migration\Service\CascadeMigrationService; | |
/** | |
* A Drush command file for managing Cascade CMS migrations. |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>MLC AI Web LLM</title> | |
<script type="module"> | |
import { MLCEngine } from "https://esm.run/@mlc-ai/web-llm"; | |
async function initialize() { |
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> | |
<meta charset="UTF-8"> | |
<title>Country Image Guess Game</title> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<div id="game"> | |
<img id="flag" src="" alt="Flag"> |
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> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> | |
<title>Product Page</title> | |
</head> | |
<body> | |
<div class="container mt-5"> | |
<div class="row"> | |
<div class="col-md-6"> |
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 | |
// Code taken from https://gist.github.com/asika32764/b204ff4799d577fd4eef | |
// Code changes by @edutrul "added https" in all responses | |
// Makes sure when creating the app you deploy to a hosting/cloud | |
// If you want to do it quickly then use heroku. | |
// When adding the app in github make sure you just add the domain name like https://example.com | |
// Notice the "https" being added in the callback, website and other fields in github page. | |
define('OAUTH2_CLIENT_ID', '<YOUR CLIENT ID>'); |
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
// File js/mymodule--feature.js | |
(function ($) { | |
Drupal.behaviors.mymodule__feature = { | |
attach: function (context, drupalSettings) { | |
// Use once to avoid tu call multiple times a js. | |
$(document).once('feature').on('click', '.button--feature', (function (event) { | |
event.preventDefault(); | |
if (typeof drupalSettings.mymodule.feature.id != 'undefined') { | |
console.log('Your great logic goes here and will NOT be called multiple times'); | |
} |
NewerOlder