Skip to content

Instantly share code, notes, and snippets.

@sld
sld / dp-agent.md
Created July 31, 2019 15:44
dp-agent logs

AIML console logs:

dp-agent|dev⚡ ⇒ docker-compose exec agent  bash
root@5ac3fdfbe6e2:/dp-agent# python3 -m core.run
[nltk_data] Downloading package punkt to /root/nltk_data...
[nltk_data]   Unzipping tokenizers/punkt.zip.
[nltk_data] Downloading package stopwords to /root/nltk_data...
[nltk_data]   Unzipping corpora/stopwords.zip.
[nltk_data] Downloading package perluniprops to /root/nltk_data...
@sld
sld / api_doc.md
Last active August 3, 2018 19:02
Api Documentation

Quick start

Get the script api_tutorial.py below and run it:

python3 api_tutorial.py http://35.159.33.67:5000

Start chat

Starts chat and returns chat_id.

@sld
sld / install-comodo-ssl-cert-for-nginx.rst
Created March 14, 2018 11:21 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@sld
sld / eliza.py
Created October 5, 2017 21:28 — forked from bebraw/eliza.py
import pyeliza
class Eliza:
aliases = 'eliza'
description = 'Virtual therapist'
_therapist = pyeliza.eliza()
def execute(self, expression, context):
'''
>>> from mock import Mock
@sld
sld / globalize_with_callbacks.rb
Created November 6, 2015 10:03
Globalize with after_add and after_remove callbacks
module GlobalizeWithCallbacks
extend ActiveSupport::Concern
class_methods do
# It is Globalize's #translates method with #after_add and #after_remove
# callbacks on :translations table. It may be used to run elasticsearch
# multilingual indexing.
#
# Define #after_translation_add and #after_translation_remove methods in
# the included class
@sld
sld / gist:4226c8ff9ff474dde0a5
Created October 24, 2014 08:29
Statistics' tasks
# coding: utf-8
import numpy as np
import cmath as math
import scipy.stats as stats
import random
def generate_exponential(exp_lambda, size):
scale = 1 / exp_lambda
@sld
sld / snake.rb
Last active December 17, 2015 23:59
snake
require 'Win32API'
def field( size )
array = Array.new(size)
for i in 0...size
array[i] = Array.new(size, 1)
end
for i in 1...size-1
for j in 1...size-1
@sld
sld / ROSALIND-20.rb
Last active December 17, 2015 18:19
ROSALIND 20 # Ruby
require 'set'
require_relative 'graph_and_ant_colony' # https://gist.github.com/sld/2711080
class String
def indexes letter
(0 .. self.length - 1).find_all { |i| self[i,1] == letter }
end
end
@sld
sld / task25.erl
Created November 1, 2012 13:36
erlang university homework
% 25. Создать приложение с тремя потоками. Потоки работают с массивами одинаковой размерности.
% Массивы содержат положительные числа.
% Потоки производят одно действие над массивом, находят произведение и сумму элементов массива,
% затем проверяют условие равенства сумм трех потоков или равенства произведений трех потоков,
% если условие выполняется, потоки завершают работу. В противном случае, все описанные шаги повторяются.
% Поток может производить над массивом следующие действия; заменить один произвольный четный элемент
% любым нечетным числом или заменить один произвольный нечетный элемент любым четным числом.
% РГР по параллельному программированию
mineralka@mineralka-borjomietc/openvpn$ cat server.conf
#################################################
# Sample OpenVPN 2.0 config file for #
# multi-client server. #
# #
# This file is for the server side #
# of a many-clients <-> one-server #
# OpenVPN configuration. #
# #
# OpenVPN also supports #