Skip to content

Instantly share code, notes, and snippets.

View vpetkovic's full-sized avatar
👾

Vojislav Petkovic vpetkovic

👾
View GitHub Profile
@vpetkovic
vpetkovic / AAA.md
Created March 30, 2023 15:24 — forked from arkada38/AAA.md
Using Tailwind CSS v3.2 with Blazor (.Net 6 or above)

Using Tailwind CSS v3.2 with Blazor (.Net 6 or above)

This method works for Blazor Server and Blazor WebAssembly with hot reload, style isolation and tailwind jit compilation.

Setup with using Standalone Tailwind CSS CLI without Node.js

For this method you need added to path Tailwind CSS CLI binary. Read more about Standalone CLI.

Just create a StaticAssets folder in the root of your project with next structure.

@vpetkovic
vpetkovic / LTT.md
Created September 16, 2022 01:11 — forked from jehugaleahsa/LTT.md
LINQ Tricks and Techniques

Learn to Love LINQ

I've been using LINQ for years and I've come to deeply respect it as a technology. Unfortunately it has not been adopted by the .NET community as much as I would have expected. I honestly believe it is the single one feature that gives C# a competitive edge over many of the other general-purpose languages out there today. This document will go over some of the tricks I have learned to make the most of LINQ's powerful features. Hopefully you'll learn at least one trick along the way.

Query vs Method syntax

Yup, you can write your queries as a series of method calls or you can use the query syntax. Method syntax is fine when you're first starting out, but query syntax is more expressive in the long run. My experience has been that operations such as where, select, join, group by and order by should be expressed using query syntax and "reduce" operations should be done in method syntax. Unavoidably, you sometimes have to use method calls inside of your queries simply because th

@vpetkovic
vpetkovic / docker-clear.bat
Created June 8, 2020 16:37 — forked from daredude/docker-clear.bat
delete all docker container and images on windows
@echo off
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi %%i
@vpetkovic
vpetkovic / UserInput.php
Created November 16, 2018 01:52 — forked from chtombleson/UserInput.php
Helper Class for sanitizing user input in PHP
<?php
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Christopher Tombleson <chris@cribznetwok.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell