Skip to content

Instantly share code, notes, and snippets.

View cyberlex404's full-sized avatar
🏠
Working from home

Lex Misiuro cyberlex404

🏠
Working from home
View GitHub Profile
void main() {
int num, count = 0;
float summ = 0;
do
{
#include <stdio.h>
#include <conio.h>
void main() {
_getch();
}
@cyberlex404
cyberlex404 / file.c
Created September 13, 2018 20:04
file.c
if ((a*2 < b) && (a*2 <c)) {
return true;
}
/**
* @inheritDoc
*/
protected function checkFieldAccess($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {
$administrative_fields = ['housing'];
if ($operation == 'edit' && in_array($field_definition->getName(), $administrative_fields, TRUE)) {
return AccessResult::allowedIfHasPermission($account, 'administer housing gallery entities');
}
function housing_entity_type_alter(array &$entity_types) {
$form_modes = \Drupal::service('entity_display.repository')->getAllFormModes();
foreach ($form_modes as $entity_type => $display_modes) {
if ($entity_type !== 'housing') {
// We are only interested in adding a handler to the Node entity.
continue;
}
/* @var \Drupal\Core\Entity\EntityTypeInterface $entity */
$entity = $entity_types[$entity_type];
<!-- Google Code for &#1047;&#1072;&#1082;&#1072;&#1079; Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1019349124;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "LlLPCOC-vXEQhJGI5gM";
var google_remarketing_only = false;
/* ]]> */
(function ($, Drupal, settings) {
"use strict";
Drupal.PublicationsCharts = Drupal.PublicationsCharts || {};
Drupal.PublicationsCharts.createChart = function (name, labels, datasets) {
var ctx = $("#chart-" + name);
console.log(ctx);
@cyberlex404
cyberlex404 / drupal-8--nginx.conf
Last active November 22, 2020 09:06
example ISP manager DRUPAL 8 nginx config
server {
server_name svkote.cyberlex404.com www.svkote.cyberlex404.com;
charset off;
index index.php index.html;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/svkote.cyberlex404.com/*.conf;
access_log /var/www/httpd-logs/svkote.cyberlex404.com.access.log;
error_log /var/www/httpd-logs/svkote.cyberlex404.com.error.log notice;
ssi on;
@cyberlex404
cyberlex404 / index.html
Last active April 8, 2018 20:22
index.html
<!DOCTYPE html>
<html>
<head>
<title>H1 Header | Мой сайт ру</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<article class="blog-post">
<?php
/**
* Created by PhpStorm.
* User: Lex
* Date: 20.02.2018
* Time: 15:32
*/
namespace Drupal\ifmo\Plugin\views\style;