Skip to content

Instantly share code, notes, and snippets.

@asankulov
asankulov / solution.js
Last active April 24, 2021 09:06
asankulov-kylych_Backend20120Hour20Test20Pre-screen
(function main() {
const origArr = [
'AMOR', 'XISELA', 'JAMON', 'ROMA', 'OMAR', 'MORA', 'ESPONJA',
'RAMO', 'JAPONES', 'ARMO', 'MOJAN', 'MARO', 'ORAM', 'MONJA', 'ALEXIS'
];
groupSimilarWordsAndPrintThem(origArr);
const str = 'foo(foo(bar(str))(opg))blim';
removeParenthesesAndReverseTheWordsInsideThem(str);
}());
@asankulov
asankulov / models.py
Created March 30, 2020 12:20
django component class exampls
class Course(models.Model):
class Meta:
verbose_name = 'Course'
verbose_name_plural = 'Courses'
trailer = models.FileField(verbose_name='Trailer', upload_to='course_trailers/')
price = models.PositiveSmallIntegerField(verbose_name='Price')
author = models.ForeignKey(CustomUser, on_delete=models.SET_NULL, null=True, blank=True, verbose_name='Author',
related_name='courses')
title = models.CharField(max_length=255, verbose_name='Title')
version: "3"
services:
nuxt_app:
container_name: nuxt_app
restart: on-failure
build: ./nuxt_app
depends_on:
- mongo
command: ["npm", "start"]
env_file:
@asankulov
asankulov / main.yaml
Created March 19, 2020 16:51 — forked from kbariotis/main.yaml
Ansible playbook for deploying a Node.js app to DigitalOcean
- name: DO
hosts: localhost
vars:
project_name: "PUT A NAME FOR YOUR PROJECT HERE"
do_token: "PUT YOUR DIGITAL OCEAN API KEY HERE ==> https://cloud.digitalocean.com/settings/api/tokens"
repository: "PUT YOUR REPOSITORY URL HERE"
tasks:
- name: LOCAL | Generate SSH key
shell: ssh-keygen -b 2048 -t rsa -f ~/.ssh/{{project_name}} -q -N ""
@asankulov
asankulov / tests.py
Created March 10, 2020 17:52
Testing Simple View
class ExchangeAPITestCase(APITestCase):
def setUp(self) -> None:
self.valid_base_query_param = 'USD'
self.valid_target_query_param = 'EUR'
self.valid_amount_query_param = 12.12
self.valid_convert_return_value = 1404.75
self.valid_serializer_data = {
'base': self.valid_base_query_param,
'target': self.valid_target_query_param,
'amount': self.valid_amount_query_param
@asankulov
asankulov / readme.md
Created April 10, 2019 08:14 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@asankulov
asankulov / doctors.js
Created April 3, 2019 18:21 — forked from elijahmanor/doctors.js
Reducing Filter and Map with Reduce
var doctors = [
{ number: 1, actor: "William Hartnell", begin: 1963, end: 1966 },
{ number: 2, actor: "Patrick Troughton", begin: 1966, end: 1969 },
{ number: 3, actor: "Jon Pertwee", begin: 1970, end: 1974 },
{ number: 4, actor: "Tom Baker", begin: 1974, end: 1981 },
{ number: 5, actor: "Peter Davison", begin: 1982, end: 1984 },
{ number: 6, actor: "Colin Baker", begin: 1984, end: 1986 },
{ number: 7, actor: "Sylvester McCoy", begin: 1987, end: 1989 },
{ number: 8, actor: "Paul McGann", begin: 1996, end: 1996 },
{ number: 9, actor: "Christopher Eccleston", begin: 2005, end: 2005 },
@asankulov
asankulov / Dockerfile
Created February 1, 2019 10:52 — forked from hermanbanken/Dockerfile
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@asankulov
asankulov / SeleniumGridTutorial.md
Created December 29, 2018 13:28 — forked from dzitkowskik/SeleniumGridTutorial.md
A simple tutorial of using selenium grid in python unittests

Prepare files & libraries

  1. Download selenium standalone server from: http://goo.gl/rQhaxb, Create local folder at ~/selenium and copy or move jar to that path:
$ mkdir ~/selenium
$ cd ~/selenium
$ wget http://goo.gl/rQhaxb
$ mv selenium-server-standalone-2.49.1.jar ~/selenium/