Skip to content

Instantly share code, notes, and snippets.

View uzbekdev1's full-sized avatar
🌴
On vacation

Elyor Latipov uzbekdev1

🌴
On vacation
View GitHub Profile
@uzbekdev1
uzbekdev1 / Dockerfile
Created March 27, 2021 10:37 — forked from grant/Dockerfile
Run Node 12 Dockerfile
# Use the official Node.js 12 image.
# https://hub.docker.com/_/node
FROM node:12
# Create and change to the app directory.
WORKDIR /usr/src/app
# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm install on every code change.
COPY package*.json ./
# Install production dependencies.
@uzbekdev1
uzbekdev1 / CarController.cs
Created March 3, 2021 09:12 — forked from johnnyreilly/CarController.cs
Unit testing ModelState using Moq
using System.Web.Mvc;
namespace MyApp
{
public class CarController : Controller
{
//...
public ActionResult Edit(CarModel model)
{
@uzbekdev1
uzbekdev1 / pdf_metadata_cleanup.md
Created February 16, 2021 13:40 — forked from righettod/pdf_metadata_cleanup.md
Java and C# code to cleanup the metadata from a PDF document.

Code sample

All librairies used are free and open source.

Java

/* 
  See https://pdfbox.apache.org 
  See https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox for released artifacts
@uzbekdev1
uzbekdev1 / MemoryCacheManager.cs
Created February 10, 2021 21:14 — forked from vlapenkov/MemoryCacheManager.cs
MemoryCacheManager
public class MemoryCacheManager
{
#region Fields
private readonly IMemoryCache _cache;
/// <summary>
/// All keys of cache
/// </summary>
/// <remarks>Dictionary value indicating whether a key still exists in cache</remarks>
@uzbekdev1
uzbekdev1 / client-socket-reconnect.js
Created January 22, 2021 17:31 — forked from sio2boss/client-socket-reconnect.js
Node.js Re-connecting Socket
//
// Simple example of using net.Socket but here we capture the
// right events and attempt to re-establish the connection when
// is is closed either because of an error establishing a
// connection or when the server closes the connection.
//
// Requires
var net = require('net');
@uzbekdev1
uzbekdev1 / complete
Created January 22, 2021 17:31 — forked from akbar-pardayev/complete
CLICK SHOP API prepare and complete requests handler simple example
<?php
error_reporting(0);
header('Content-Type: text/json');
header('Charset: UTF-8');
$request = $_POST;
$merchant_id = 'YOUR MERCHANT ID';

Features of Minio Server.

Item Specification
Custom access key environment MINIO_ACCESS_KEY
Custom secret key environment MINIO_SECRET_KEY
Turn off web browser environment MINIO_BROWSER=off
Listening on bucket notifications using an extended S3 API
Support for bucket notifications postgres, amqp, nats, elasticsearch, redis, kafka (in-progress)
Shared Backend (FS) In-progress
@uzbekdev1
uzbekdev1 / nginx.conf
Created January 18, 2021 07:55 — forked from steve-ng/nginx.conf
Nginx reverse proxy wss with ssl
server {
listen 443 ssl;
server_name xxx.xx.io
ssl on;
ssl_certificate /etc/asterisk/certs/xxx.io.pem;
ssl_certificate_key /etc/asterisk/certs/xxx.io.key;
ssl_session_timeout 5m;
@uzbekdev1
uzbekdev1 / gist:3a562a1edf03cb7e49ab966556055e05
Created December 26, 2020 20:28 — forked from stereokai/gist:36dc0095b9d24ce93b045e2ddc60d7a0
CSS rounded corners with gradient border
.rounded-corners-gradient-borders {
width: 300px;
height: 80px;
border: double 4px transparent;
border-radius: 80px;
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff);
background-origin: border-box;
background-clip: content-box, border-box;
}
@uzbekdev1
uzbekdev1 / validation_optimization.txt
Created December 22, 2020 09:06
Strange challenge - validation of strings and optimization of code [30 min for both]
Author's punctuation style is preserved.
Challenge:
- Assume most recent language standard are available (ES6)
- We expect good performance.
- If missing more requirements details, just make reasonable assumptions of your own.
- Solution must be simple and compact.
No defensive coding, no comments, no unrequested features.
Only one file 10-20 lines of code
- Work only inside Google Docs: no external editor/IDE/debugger, no copy-paste to/from such an editor.