Skip to content

Instantly share code, notes, and snippets.

View Gaikanomer9's full-sized avatar

Nikita Zavyalov Gaikanomer9

View GitHub Profile
https://github.com/app-sre/qontract-reconcile.git 30af65af14a2dce962df923446afff24dd8f123e
https://github.com/app-sre/container-images.git c260deaf135fc0efaab365ea234a5b86b3ead404
https://github.com/Gaikanomer9/rasa-docker-bot.git 3aa0e32f68631cdcd0f757d0f6be4ee486f1a693
https://github.com/Gaikanomer9/cloud-build-notifiers.git 2f9eebce378bf38964345d674e0969b9afe9ccbc
https://github.com/Gaikanomer9/rasa-docker-bot.git invalid_sha
https://github.com/Gaikanomer9/rasa-docker-bot.asdgit invalid_sha
@Gaikanomer9
Gaikanomer9 / ya.py
Created September 16, 2020 17:03
Simple example
# время (O(n1)), память O(n1+2*n2)
# Данное решение использует hash таблицу и позволяет быстро определять - находится ли элементов во втором списке
# Из минусов - выделение дополнительной памяти для сета второго списка
arr1=[1,2,3,4,5]
arr2=[3,4,5,6,7]
def process_list(arr1, arr2):
arr2_s = set(arr2)
return list(filter(lambda x: x not in arr2_s, arr1))
import os
from flask import request
from flask import Flask
app = Flask(__name__)
@app.route("/", methods=["GET"])
def hello_there():
return "Hello Cloud Run", 200
<!-- Script for extracting url params -->
<script type="text/javascript">
function setupCookie(cookieName, cookieValue) {
var cookiePath = '/'
var expirationTime = 2592000 //time the cookie should expire in seconds
expirationTime = expirationTime * 1000 //Convert expirationtime to milliseconds
var date = new Date() //Create new date
var dateTimeNow = date.getTime() //What is the current time in milliseconds
date.setTime(dateTimeNow + expirationTime) //Set expiration time
var expirationTime = date.toUTCString() //Convert milliseconds to UTC time string
@Gaikanomer9
Gaikanomer9 / main.py
Last active January 10, 2019 10:19
Sample Flask app for webhook handling at Dialogflow
# -*- coding: utf-8 -*-
from flask import Flask, request, make_response, jsonify
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
req = request.get_json(force=True)
intent = req.get('queryResult').get('intent').get('displayName')