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
// LOAD AJAX PAGES
function loadURL(url, container) {
$.ajax({
type: "GET",
url: url,
dataType: 'html',
cache: true,
beforeSend: function(){
container.html('<h1><i class="fa fa-cog fa-spin"></i> Loading...</h1>').fadeIn('fast');
},
@uzbekdev1
uzbekdev1 / crypto.cs
Created February 25, 2018 13:03 — forked from zachbonham/crypto.cs
RSA public key encryption in C#
using System;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Text;
namespace Crtypto
{
class Program
{
static void Main(string[] args)
@uzbekdev1
uzbekdev1 / gist:6c46411f41cfecff0d5b06b684636e9a
Created March 24, 2018 14:44 — forked from rippinrobr/gist:3241701
updated app.config file to add Npgsql as a data provider for this app.
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<connectionStrings>
<add name="hockeydb"
connectionString="Server=127.0.0.1;Port=5432;Database=hockeydb;User Id=demo;Password=demo;"
providerName="Npgsql"
/>
</connectionStrings>
<system.data>
@uzbekdev1
uzbekdev1 / bracketsMatchingTest.js
Created May 4, 2018 09:23 — forked from jenyayel/bracketsMatchingTest.js
Implement function check (text) which checks whether brackets within text are correctly nested. You need to consider brackets of three kinds: (), [], {}.
var expect = require('expect')
var _matches = {
'{': { invert: '}', isOpening: true },
'}': { invert: '{', isOpening: false },
'(': { invert: ')', isOpening: true },
')': { invert: '(', isOpening: false },
'[': { invert: ']', isOpening: true },
']': { invert: '[', isOpening: false }
};
@uzbekdev1
uzbekdev1 / DomainRoute.cs
Created May 16, 2018 12:04 — forked from IDisposable/DomainRoute.cs
Domain (hostname) Routing for Asp.Net MVC and WebAPI
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Http;
using System.Web.Http.Routing;
using System.Web.Mvc;
@uzbekdev1
uzbekdev1 / DomainRoute.cs
Created May 16, 2018 12:04 — forked from fiting/DomainRoute.cs
Domain (hostname) Routing for Asp.Net MVC and WebAPI
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Http;
using System.Web.Http.Routing;
using System.Web.Mvc;
@uzbekdev1
uzbekdev1 / ProcessUtil.cs
Created June 5, 2018 20:14 — forked from mxpv/ProcessUtil.cs
Process start helper utility with CancellationToken and async output reading support
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Threading;
using Microsoft.Win32.SafeHandles;
namespace ConsoleApplication
{
public class ProcessUtil : IDisposable
{
@uzbekdev1
uzbekdev1 / ProcessHelper.cs
Created June 5, 2018 20:24 — forked from gokulraja/ProcessHelper.cs
Process Start Helper C#
private static void ProcessHelper(string fileName, string arguments, bool showResultsinConsole)
{
// Start the child process.
using (var p = new Process{
StartInfo =
{
UseShellExecute = false,
CreateNoWindow = true,
@uzbekdev1
uzbekdev1 / gist:0f9b4530a0ca97b6aba5e8e830e61edc
Created July 28, 2018 18:16 — forked from oneillci/gist:3205384
Using EF Include() with generic repository
public IQueryable<T> FindBy(Expression<Func<T, bool>> predicate, params Expression<Func<T, object>>[] includes)
{
var query = GetAll().Where(predicate);
return includes.Aggregate(query, (current, includeProperty) => current.Include(includeProperty));
}
// Sample usage
userRepository.FindBy(x => x.Username == username, x.Roles)
@uzbekdev1
uzbekdev1 / remove_watermark.py
Created August 25, 2018 09:03 — forked from Arnie97/remove_watermark.py
Removes the annoying watermarks of it-ebooks.info's downloaded eBooks
#!/usr/bin/env python3
import sys
import re
import shutil
import argparse
import binascii
#
# Author: Daxda