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
@AlexanderBaggett
AlexanderBaggett / gist:d1504da93727a1778e8b5b3453946fc1
Last active October 15, 2024 08:56
Full win32 window from C# with Pinvoke
In this post, .net platform has this pinvoke mechanism where it is allowed that you call into the Native windows .
this is extremely useful when you have some 3rd party libraries or if you try to program against with the low-level windows APIS.
One of the typic application htat utilize the Lowe-level windows apis are those Native win32 applications. Where you creat a message pump with the necessary WNDCLASSEX to represent/register the window message pump and message handler process. What you will deal with the win32 applications include the following.
RegisterClassEx, CreateWindowEx, GetMessage(), TranslateMesage(), and DispatchMessage(...).
to be able to use the Window API, you have to declare tons of Structure and PInvoke Method, while you can find help from the Pinvoke.Net.
First, we will introduce some of the win32/user32 functions and their relative structure definitions.
# coding: utf-8
# # Object Detection Demo
# Welcome to the object detection inference walkthrough! This notebook will walk you step by step through the process of using a pre-trained model to detect objects in an image. Make sure to follow the [installation instructions](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md) before you start.
# # Imports
# In[1]:
@davidsheardown
davidsheardown / Encryption.cs
Created December 8, 2017 09:41
.NET Core 2 Encrypt/Decrypt String
public static void Main(string[] args)
{
var content = "Example test";
var key = "E546C8DF278CD5931069B522E695D4F2";
var encrypted = EncryptString(content, key);
Console.WriteLine(encrypted);
var decrypted = DecryptString(encrypted, key);
Console.WriteLine(decrypted);
@emptyother
emptyother / Guid.ts
Last active July 4, 2023 21:00
GUID class for Typescript
class Guid {
public static newGuid(): Guid {
return new Guid(crypto.randomUUID());
// Old IE supported way:
/*return new Guid('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
const r = Math.random() * 16 | 0;
const v = (c == 'x') ? r : (r & 0x3 | 0x8);
return v.toString(16);
}));*/
HOLY SMOKES! This one was very troublesome, but I figured it out after days of trying.
So, there are a lot of partial answers out there, but this should be complete. You cannot from what I have seen, include jquery-ui in your angular-cli and the index. The plugin inclusions will be overwritten and jquery as a global will be undefined. I couldn't get it to work by using just the angular-cli.json, but I did get it to work by only using index inclusion.
Here is what needs to be done to only use index script inclusion for jquery/jquery-ui.
1: Uninstall jquery and jquery-ui and remove it from the package.json
npm uninstall --save jquery jquery-ui
2: Delete the node_modules folder
@ibraheem4
ibraheem4 / postgres-brew.md
Last active April 19, 2025 14:27 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@Bewitchedyegor
Bewitchedyegor / daterangepicker_ru.js
Created October 12, 2017 13:43
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: 'Отмена',
@artisticcheese
artisticcheese / Dockerfile
Last active June 2, 2021 13:03
Dockerfile to build IIS + nanoserver + ASP.NET core
# escape=`
# Image with NET CORE installation to extract executables for final image
FROM microsoft/aspnetcore:2.0.0-nanoserver As CoreBuild
# Middleware image used to extract ASP.NET core module
From microsoft/iis as WindowsBuild
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'Continue'; $verbosePreference='Continue';"]
# Installing NET CORE webhosting in middleware image so latest module and configuration schema is extracted for final image
ADD https://download.microsoft.com/download/B/1/D/B1D7D5BF-3920-47AA-94BD-7A6E48822F18/DotNetCore.2.0.0-WindowsHosting.exe ".\hosting.exe"
@jacobovidal
jacobovidal / .htaccess
Last active September 5, 2024 18:28
Upgrade Insecure Requests via .htaccess or meta tag to prevent mixed content
<ifModule mod_headers.c>
Header always set Content-Security-Policy "upgrade-insecure-requests;"
</IfModule>
@open-ruic
open-ruic / Program.cs
Last active February 11, 2020 18:30
C# RSA Key Utils
using System;
namespace PKCS1ToPKCS8Application
{
class Program
{
static void Main(string[] args)
{
byte[] importedPrivateKeyBytes = Convert.FromBase64String("MIIEowIBAAKCAQEAtuHuMvnE3fYz/eom8mF7xxLXPETjfUpVYHL6AUVwXKKCrZ6uFszh2bY7ADoiIpuPTS0NVNYeKLlu6T59qzyr0bnT8KgXdZJFVzYWIh8VOLTb2zghlu8BeBoJP9t/a34Mj7gGJUZWBgECopEGCXrFwyIvXSW0JU5YrJinyyPhUjUXLeyowJUXoLwEafOHBRRiZZv1SNlntQOAenHFB/1uv2Y5xmdHm7xl+jjeo469u+pY535RCekmam9hWbZcn/WZEf9BZEmE2i4v7Qj72V92LrSUSSjF6w6lgU3B+Byu0XR8ZeUjD+FP9ZKvJyEtxlxOVaADQ+/udghUr1PnfXIHRQIDAQABAoIBAHG1UBFJ0unfJrx9VfHmQruoL0M94eQIz8TEOEWKEy7FrFKfEscCZHqlH1Io0wiJiDQICv3wk5fmk9taC3DorDweOnSrTsq/Q3XSHzjf8qXrbbeD0v6xZEx0g8O8iiEfolfJp6iNbvcUsbq6SPKj70pAewqDYtq/N8s4rztS98nQQ5PAQ10Zv3X910lc0vnPlPKew4y7w6hwb/pbiEBLbbV9tYAVaAm63n/EYxjo3UCRA0BJZxhJbRdEQzCEzClXlo6txx7nGQz/omv574P22ASCAfyrFNhaT20DR+ilIXe+edBpJehD6Q/lpO56STawb9xCAk6+aerM5dcIBMTETRECgYEA3RdnfpY1Z8KtOT1rVUeI094vylP1HONrcXNSsV0sbNPSwoK91UpO0mfsLLWxLtjvX52yixhfKxQ0QLYq3nyC8SRj2GE07aO1HZ81MI/9Y6ynJkw+