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
<?php
namespace Drupal\telegram_holiday\Plugin\TelegramBots;
use Drupal\telegram_bots_api\TelegramBotBase;
/**
* @TelegramBot(
* id = "BraslavskieHolidayBot",
* bot = "braslavskie_holiday_bot",
@cyberlex404
cyberlex404 / BraslavskieHolidayBot.php
Created March 20, 2017 03:33
Example Telegram bot
<?php
namespace Drupal\telegram_holiday\Plugin\TelegramBots;
use Drupal\telegram_bots_api\TelegramBotBase;
use Telegram\Bot\Commands\Command;
use Telegram\Bot\Objects\Update;
use Drupal\holiday\InquiryInterface;
use Drupal\telegram_holiday\Commands\QuestionCommand;
use Drupal\telegram_holiday\Entity\TelegramDialog;
langcode: en
status: true
dependencies:
config:
- field.field.node.hoover.body
- node.type.hoover
module:
- path
- text
id: node.hoover.default
<?php
/**
* @file
* An example field using the Field Types API.
*/
/**
* @defgroup field_example Example: Field Types API
* @ingroup examples
* @{
@cyberlex404
cyberlex404 / dev.py
Last active April 10, 2017 21:57 — forked from mikl745/dev.py
stroka = input() # Мы читаем ВСЮ строку в переменную
#stroka = 'bye bye.'
mywords = stroka[0:-1].split() # разделяем split() строку без последнего символа '.'
min = len(mywords[0]) + len(mywords[1])
res = mywords[0] + ' ' + mywords[1]
for i in range(1, len(mywords)-1):
cur = len(mywords[i]) + len(mywords[i+1])
if(cur < min):
res = mywords[i] + ' ' + mywords[i+1]
min = cur
w = int(input())
a = [int( input()) for x in range(w)]
y = []
w = []
def delit(n):
for i in range(1,n+1):
if n % i == 0:
w.append(i)
return w
print(dilit(min(a))
@cyberlex404
cyberlex404 / trydevper.py
Created April 23, 2017 21:13 — forked from mikl745/trydevper.py
true reshenie
i = int(input())
a = [int( input()) for x in range(i)]
listDel = []
def delit(n):
w = []
for i in range(1,n // 2 + 1):
if n % i == 0:
w.append(i)
@cyberlex404
cyberlex404 / trydevper.py
Created April 24, 2017 21:00
with time()
import time
class Profiler(object):
def __enter__(self):
self._startTime = time.time()
def __exit__(self, type, value, traceback):
print("Elapsed time: {:.3f} sec".format(time.time() - self._startTime))
@cyberlex404
cyberlex404 / trydevper.py
Created April 24, 2017 21:10
good version
k = int(input())
a = [int( input()) for x in range(k)]
outputDel = []
firstDel = []
# поиск делителей числа
def delit(n):
w = []
for i in range(1,n // 2 + 1):
cyberlex@cs53836 ~/www/holiday.braslavskie.by $ drupal
Drupal Console (1.0.0-rc16)
===========================
Copy configuration files.
drupal init
Install a Drupal project