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 / tar_test.c
Created January 3, 2020 17:39 — forked from danikin/tar_test.c
Tarantool Quick Test
// Tarantool quick test
// Copyright, Dennis Anikin 2016
//
// Quick disclaimer:
//
// This test shows 500K-1000K transactions per second on one CPU core
// and 600K-1600K queries per second on one CPU core.
//
// Based on the $6.57 per-month-price for the AWS t2.micro instance we can afford the tremendous number of 630bln queries for just $1
//
@uzbekdev1
uzbekdev1 / daterangepicker_ru.js
Created December 29, 2019 13:44 — forked from Bewitchedyegor/daterangepicker_ru.js
Localize Bootstrap daterangepicker to Russian
$('input[id="pick_period2"]').daterangepicker({
singleDatePicker: true,
showDropdowns: false,
minDate: moment(today).add(1, 'days'),
maxDate: moment(today).add(45, 'days'),
//add locale to your daterangepicker call function
locale: {
format: 'DD-MM-YYYY',
applyLabel: 'Принять',
cancelLabel: 'Отмена',
@uzbekdev1
uzbekdev1 / gist:a367b8b6db975ec3a70686874ddd18d5
Created December 17, 2019 13:19 — forked from jferguson/gist:1681480
SqlBulkCopy Generic List<T>
public static void BulkInsert<T>(string connection, string tableName, IList<T> list)
{
using (var bulkCopy = new SqlBulkCopy(connection))
{
bulkCopy.BatchSize = list.Count;
bulkCopy.DestinationTableName = tableName;
var table = new DataTable();
var props = TypeDescriptor.GetProperties(typeof(T))
//Dirty hack to make sure we only have system data types
@uzbekdev1
uzbekdev1 / blazor-auth.md
Created September 25, 2019 09:44 — forked from SteveSandersonMS/blazor-auth.md
Blazor authentication and authorization

Authentication and Authorization

Authentication means determining who a particular user is. Authorization means applying rules about what they can do. Blazor contains features for handling both aspects of this.

It worth remembering how the overall goals differ between server-side Blazor and client-side Blazor:

  • Server-side Blazor applications run on the server. As such, correctly-implemented authorization checks are both how you determine which UI options to show (e.g., which menu entries are available to a certain user) and where you actually enforce access rules.
  • Client-side Blazor applications run on the client. As such, authorization is only used as a way of determining what UI options to show (e.g., which menu entries). The actual enforcement of authorization rules must be implemented on whatever backend server your application operates on, since any client-side checks can be modified or bypassed.

Authentication-enabled templates for Server-Side Blazor

@uzbekdev1
uzbekdev1 / media-query.css
Created September 10, 2019 06:58 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@uzbekdev1
uzbekdev1 / AndroidMainfest.xml
Created August 19, 2019 20:56 — forked from jayrambhia/AndroidMainfest.xml
First Android OpenCV Application.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.imgloader"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
@uzbekdev1
uzbekdev1 / list.component.html
Created July 16, 2019 17:07 — forked from bentedder/list.component.html
Pagination Component
<div>list of things</div>
<my-pagination
(goPage)="goToPage($event)"
(goNext)="onNext()"
(goPrev)="onPrev()"
[pagesToShow]="3"
[page]="page"
[perPage]="limit"
[count]="total"></my-pagination>
@uzbekdev1
uzbekdev1 / count_up.js
Created July 6, 2019 16:13 — forked from noahub/count_up.js
Count Up Animation
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
$('.counter').each(function() {
var $this = $(this),
countTo = $this.attr('data-count');
$({ countNum: $this.text()}).animate({
countNum: countTo
@uzbekdev1
uzbekdev1 / C#
Created June 21, 2019 14:24 — forked from conrjac/C#
C# Encrypt and Decrypt File - using http://support.microsoft.com/kb/307010
using System;
using System.IO;
using System.Security;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using System.Text;
namespace CSEncryptDecrypt
{
class Class1
http://cronus.allowed.org works for me, 2018.1.6