Skip to content

Instantly share code, notes, and snippets.

@extstopcodepls
extstopcodepls / IQueryableExtensions.cs
Created December 30, 2024 12:14 — forked from ErikEJ/IQueryableExtensions.cs
Replacement for EF Core .Contains, that avoids SQL Server plan cache pollution
using System.Linq.Expressions;
namespace Microsoft.EntityFrameworkCore
{
public static class IQueryableExtensions
{
public static IQueryable<TQuery> In<TKey, TQuery>(
this IQueryable<TQuery> queryable,
IEnumerable<TKey> values,
Expression<Func<TQuery, TKey>> keySelector)
@extstopcodepls
extstopcodepls / index.js
Last active October 10, 2024 06:39
Add "Create Merge Requests" to gitlab MR dropdown
// ==UserScript==
// @name Add authored MRs
// @namespace http://tampermonkey.net/
// @version 2024-10-09
// @description try to take over the world!
// @author You
// @match http://gitlab.x-code.loc/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=x-code.loc
// @grant unsafeWindow
// ==/UserScript==
@extstopcodepls
extstopcodepls / gist:d7374f8eb8fc8524ef38e86299ae8137
Created September 30, 2024 07:55
SqlServer 2022 from official ms image with full text search
FROM mcr.microsoft.com/mssql/server:2022-latest
USER root
RUN apt-get update && \
apt-get install -y software-properties-common && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y curl
@extstopcodepls
extstopcodepls / main.js
Last active November 27, 2023 18:04
gitlab add labels to linked items
// ==UserScript==
// @name GitLab Related Issue Labels
// @match http://gitlab.x-code.loc/*/issues/*
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Showing labels for related issues
// @author Simon Pamies
// @author Dimitar Pavlov
// @grant none
// @require http://code.jquery.com/jquery-1.12.4.min.js
"Watch": {
"commandName": "Executable",
"executablePath": "dotnet",
"workingDirectory": "$(ProjectDir)",
"hotReloadEnabled": true,
"hotReloadProfile" : "aspnetcore",
"commandLineArgs": "watch run",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
@extstopcodepls
extstopcodepls / gist:f4be8f425784706f9ceb6fc2ce0e1de2
Created February 28, 2019 14:33 — forked from DexterHaslem/gist:3249480
AutomationElement pinvoke right click
// add references WindowsBase, UIAutomationClient, UIAutomationTypes
// using System.Windows.Automation;
// using System.Windows;
[DllImport("user32.dll", CharSet = CharSet.Auto)] static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
public void RightClick(AutomationElement element)
{
const int WM_LBUTTONDOWN = 0x0201;
const int WM_LBUTTONUP = 0x0202;
Point point = element.GetClickablePoint();
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
choco install git
choco install notepadplusplus
choco install 7zip
choco install scriptcs
choco install dotnet4.6
choco install visualstudio2015community
@extstopcodepls
extstopcodepls / ellipsis
Created March 18, 2014 07:57
ellipsis function, works for ie
(function ($) {
$.fn.ellipsis = function () {
return this.each(function () {
var el = $(this);
if (!el.hasClass('running-ellipsis')) {
var text = el.html();
var divToMark = text.substr(text.indexOf('<div')); //div z trójkątem przy rozwijaniu/zwijaniu pozycji w lewym menu
if (divToMark.length > 1) {
text = text.substr(0, text.indexOf('<div')); //usunięcie tego trójąta ze sprawdzango tekstu
@extstopcodepls
extstopcodepls / phpvalidaterelaxng
Created March 17, 2014 16:34
php validate of xml
<?php
$dom = new DOMDocument;
$dom->load('studenci.xml');
if($dom->relaxNGValidate('xml.rng'))
{
echo "udało się \n";
}
@extstopcodepls
extstopcodepls / xmlrelaxng
Created March 17, 2014 16:30
xml for relaxng
<studenci>
<student prywatny="tak">
<imie />
<nazwisko />
</student>
</studenci>