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 / 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
@uzbekdev1
uzbekdev1 / test.c
Created August 27, 2018 05:59 — forked from gin1314/test.c
C++ : Win32 API InternetOpen example
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <winsock.h>
#include <wininet.h>
#include <shellapi.h>
#include <mmsystem.h>
typedef struct vs {
char host[128];
@uzbekdev1
uzbekdev1 / IoC example
Created October 3, 2018 11:02 — forked from jgauffin/IoC example
Examples on how to create unit of work in WinForms/WPF applications
// simple example, can of course be simplified using a ioc wrapper.
public void Button1_Clicked(object source, EventArgs empty)
{
using (var scope = Program.Autofac.BeginLifetimeScope())
{
var uow = scope.Resolve<IUnitOfWork>();
var repos = scope.Resolve<IUserRepository>();
var user = repos.GetUser(1);
user.LastName = txtLastName.Text;
@uzbekdev1
uzbekdev1 / 30_under_30_europe_linkedin_info_final.csv
Created October 5, 2018 06:41 — forked from baditaflorin/30_under_30_europe_linkedin_info_final.csv
Forbes 30 under 30 Europe 2018 list containing 384 persosns. For 308 of them there is also the LinkedIn profile, if they have.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
Category were the 30 under 30 person was selected,Forbes Name,Forbes Age,Forbes Country,Role in the Company,Company,Description,LinkedIn Profile,linkedin_name,Exact match between the name ?,Did I had o perform a manual searh to find the linkedin profile ?
30 Under 30 - Europe - Social Entrepreneurs,Margherita Pagani,29,Argentina,Founder, Impacton.org,"Pagani aims to create an encyclopedia of blueprints for of purpose-driven projects for impact investing. The Italian-born and Argentina-based entrepreneur believes works with universities, governments and private companies to co-design programs based on proven models.",https://www.linkedin.com/in/magheritapagani,Margherita Pagani - CEO and Founder - Impacton.org ,FALSE,NO
30 Under 30 - Europe - Media & Marketing,Mohamed Khairat,25,Australia,Cofounders, Egyptian Streets,"Amin and Khairat founded Egyptian Streets back in 2012, less than two years after the Arab Spring. The digital publication that strives to address challenging issues--such as sexual harassment an
@uzbekdev1
uzbekdev1 / Startup.cs
Created October 11, 2018 08:15 — forked from wallymathieu/Startup.cs
HowTo register auth for swashbuckle with identity server on asp.net core
Namespace ProjectWithSwagger
{
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container
public void ConfigureServices(IServiceCollection services)
{
//....
services.ConfigureSwaggerGen(swaggerGen =>
{
@uzbekdev1
uzbekdev1 / Leap code
Created October 18, 2018 12:42 — forked from IrisClasson/Leap code
Dispatcher.BeginInvoke versus Dispatcher.InvokeAsync
private void SetCanvas(UIElement image, Point point, bool allowkill)
{
Dispatcher.BeginInvoke(
new Action(
delegate
{
Canvas.SetTop(image, point.Y - (finger.ActualHeight/2));
Canvas.SetLeft(image, point.X - (finger.ActualWidth/2));
if (allowkill)
import {MatDialogModule} from "@angular/material";
@NgModule({
declarations: [
...
CourseDialogComponent
],
imports: [
...
@uzbekdev1
uzbekdev1 / sites.cleanup
Created November 20, 2018 09:20 — forked from yurifedoseev/sites.cleanup
Delete all sites from IIS express configuration
appcmd.exe list site /xml | appcmd delete site /in
@uzbekdev1
uzbekdev1 / payone
Created December 30, 2018 08:10 — forked from otarza/payone
<form action="https://secure.pay1.de/client-api/" method="POST">
<input type="hidden" name="portalid" value="2000000">
<input type="hidden" name="aid" value="10000">
<input type="hidden" name="mode" value="test">
<input type="hidden" name="request" value="bankaccountcheck">
<input type="hidden" name="successurl" value="http://www.yoursite.com/success.php">
<input type="hidden" name="errorurl" value="http://www.yoursite.com/error.php">
<input type="hidden" name="hash" value="70eaec2a33fa1b4674c0b1ge5e982966">
<input type="hidden" name="responsetype" value="REDIRECT">
<input type="hidden" name="language" value="en">