Skip to content

Instantly share code, notes, and snippets.

@bigslycat
bigslycat / main.js
Last active November 6, 2018 18:28 — forked from Msx1/main.js
$(document).ready(function () {
$('.deleteUser').on('click', deleteUser)
});
function deleteUser() {
alert('Опа ' + $(this).data('id') + ' гангнам стайл!');
if (confirm('Are You Sure?')) {
$.ajax({
type: 'DELETE',
FROM node:10.9.0-alpine as builder
# Это мы отнаследовались от образа ноды на базе Альпайн-линукса,
# и она у на сейчас просто есть, и мы можем запускать её как в
# процессе билда, так и при запуске контейнера из этого образа.
# Так же мы этот этап сборки обзываем "builder", а зачем — узнаем ниже.
# Задаём рабочую дирректорию по умолчанию
WORKDIR /app
# Добавляем в образ текущуу директорию хост-системы
@bigslycat
bigslycat / docker-cheatsheet.sh
Last active January 22, 2020 17:04
Docker commands cheatsheet
# Stop all running containers
docker stop $(docker ps -q | paste -sd " " -)
# Stop and remove all containers
docker rm -f $(docker ps -aq | paste -sd " " -)
# Stop and remove all images
docker rmi -f $(docker images -aq | paste -sd " " -)
@bigslycat
bigslycat / findify_challenge.md
Last active January 24, 2018 13:33 — forked from Bitaru/findify_challenge.md
Findify Challenge

TASK:

Implement a "withModal" high order component (HOC) that will accept two arguments [modalName: String] and [modalComponent: React.Component]. It should render a "modalComponent" into the portal. In addition, this HOC should inject 'showModal' and 'hideModal' handlers into a new collection of props that are passed to the base component. For instance:

import React, { Fragment } from 'react'
import { createPortal } from 'react-dom'

import {
  withStateHandlers,
/* @flow */
import moment from 'moment-timezone';
const isAcceptByArrayRules = (arr: any[], given: any) => !arr.length || arr.includes(given);
const timeBlocksFilter = (
byCity: string[],
byClinic: string[],
bySpec: string[],
byMedic: string[],
/* @flow */
export type ResponseError = {
success: false,
message: string,
};
export type GetClientByBarcode = {
success: true,
result: {
'use strict';
import React from 'react';
class Controls extends React.Component {
constructor(props) {
super(props);
this.controlsStyle = {position: 'absolute'};
}
moveLeft = () => this.props.swapModules(this.props.module, 'left');
'use strict';
import http from 'http';
import express from 'express';
import Bluebird from 'bluebird';
import socketIo from 'socket.io';
import { PORT } from '../config/env';
global.Promise = Bluebird;