This file contains 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
@Sse('sse') | |
sse() { | |
const subject = new Subject(); | |
setTimeout(() => { | |
Array.from(Array(1000).keys()).forEach((i) => { | |
subject.next({ | |
data: { | |
message: `Message #${i}`, | |
}, |
This file contains 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
/** | |
* Validates the entity against its configuration. | |
* | |
* @return bool | |
* TRUE if the entity is valid, FALSE otherwise. | |
*/ | |
public function validate(): bool { | |
foreach ($this->config as $type => $type_config) { | |
// Check if the entity has any days of this type. | |
if (!isset($this->data[$type])) { |
This file contains 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
server { | |
listen 80; | |
listen [::]:80; | |
server_name localhost; | |
location / { | |
root /usr/share/nginx/html; | |
try_files $uri $uri/ /index.html; | |
index index.html index.htm; | |
} |
This file contains 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> | |
<style> | |
table { | |
font-family: arial, sans-serif; | |
border-collapse: collapse; | |
width: 100%; | |
} | |
This file contains 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
# Symfony editor configuration normalization | |
# @see http://editorconfig.org/ | |
; top-most EditorConfig file | |
root = true | |
; Unix-style newlines | |
[*] | |
end_of_line = lf | |
charset = utf-8 |
This file contains 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
# Drupal editor configuration normalization | |
# @see http://editorconfig.org/ | |
# This is the top-most .editorconfig file; do not search in parent directories. | |
root = true | |
# All files. | |
[*] | |
end_of_line = LF | |
indent_style = space |
This file contains 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 | |
* Contains \Drupal\module_name\SiteSettingsForm. | |
*/ | |
namespace Drupal\module_name\Form; | |
use Drupal\Core\Form\ConfigFormBase; |
This file contains 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 db_select($table,$query) { | |
$pdo = new PDO('mysql:host='.DB_HOST.';'.'dbname='.DB_NAME.'', '.DB_USER.', ''); | |
$quey_key = array_keys($query); | |
$query_values = array_values($query); | |
$sql_query_condition = ""; | |
for($i = 0; $i < count($quey_key); $i++){ | |
if(!$quey_key[$i+1]){ | |
$sql_query_condition .= $quey_key[$i] . "=?"; |