Skip to content

Instantly share code, notes, and snippets.

@jzi96
jzi96 / debounce-throttle.razor
Created September 22, 2021 18:12
Sample for debouncing and throttling events in .net(5)
@page "/"
<h2>Throttle</h2>
<input type="text" @oninput="onInputThrottled" />
Value: @value1
<h2>Debounce</h2>
<input type="text" @oninput="onInputDebounced" />
Value: @value2
@code{
//REM Git for Windows +
//+++ FOR POWERSHELL +++
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
//?
Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck
--http://therightstuff.de/2007/11/19/How-To-Obtain-The-Size-Of-All-Tables-In-A-SQL-Server-Database.aspx
SET NOCOUNT ON
DBCC UPDATEUSAGE(0)
-- DB size.
EXEC sp_spaceused
-- Table row counts and sizes.
CREATE TABLE #t
@jzi96
jzi96 / Msbuild Captures
Last active March 4, 2016 10:26
Ideas and snippet for MsBuild fiiles - Propertygroup and task to convert xsd to cs before build
<!--Propertygroup and task to convert xsd to cs before build
Item must have Property MyXsd
-->
<None Include="Configuration\Parameter.xsd">
<SubType>Designer</SubType>
<MyXsd>Custom</MyXsd>
</None>
<PropertyGroup>
<WIN_SDK_PATH>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows@CurrentInstallFolder)</WIN_SDK_PATH>
@jzi96
jzi96 / Typescript generic sort function
Created October 28, 2015 16:10
This is a sortfunction implemented with typescript
function sort<T>(sortItems: T[], key: (item: T) => any): T[]{
var res = sortItems.slice(0);
res.sort(function (a, b) {
var akey = key(a);
var bkey = key(b);
return akey > bkey ? 1 : akey < bkey ? -1 : 0;
});
return res;
}
@jzi96
jzi96 / ChangePowerpoint language
Created October 23, 2015 08:40
This is a guide howto change the language of all power point slides to ... Found this in https://msdn.microsoft.com/en-us/library/aa432635.aspx
ry the following steps:-
Step 1:- By using Macro we can change the language in powerpoint for all slides.
Create a new macro:
1. Go to Tools, Macro, and Visual Basic Editor.
2. Insert a new empty module by selecting Insert, Module.
3. Paste this code on the right panel and save the macro:
Option Explicit
Public Sub ChangeSpellCheckingLanguage()
@jzi96
jzi96 / PortCheck.ps1
Created October 14, 2015 08:42
Small Powershell script to check a specific port on host, if that can be accessed. (Old telnet style port check) This can be useful, if you are behind a firewall.
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$hostname,
[Parameter(Mandatory=$True,Position=2)]
[int]$port
)
try {
@jzi96
jzi96 / managedataprovider.config
Created May 11, 2015 13:35
Oracle Managed Data Provider .NET enable options (tested with 4.121.2.0)
<configuration>
<configSections>
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler,Oracle.ManagedDataAccess" />
</configSections>
<oracle.manageddataaccess.client>
<version number="*">
<settings>
<setting name="PerformanceCounters" value="4095"/>
<setting name="TraceFileLocation" value="c:\temp"/>
<setting name="TraceLevel" value="7"/>
@jzi96
jzi96 / AsyncTaskConverter
Created April 28, 2015 13:41
This is a helper class to convert Begin-/End- Async pattern method to Tasks and use feature of the new .NET FX functions
public static class AsyncTaskConverter
{
public static Task FromAsync<TParameter>(Func<TParameter, AsyncCallback, object, IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TParameter parameter, object state)
{
if (beginMethod == null)
throw new ArgumentNullException("beginMethod");
if (endMethod == null)
throw new ArgumentNullException("endMethod");
var tcs = new TaskCompletionSource<bool>();
@jzi96
jzi96 / gist:01810032ce5f3b87c285
Last active August 29, 2015 14:18
Oracle delete data from large tables keeping only a few data (temp table)
--DROP TABLE acctmp3;
DECLARE
table_name varchar(20);
begin
table_name := 'acctmp';
DBMS_OUTPUT.PUT_LINE('Deleting table ' ||table_name);
execute immediate 'truncate table ' || table_name;
execute immediate 'drop table ' || table_name;