.NET, VB/C#
.NET 6
- Copy text to clipboard
- install package TextCopy into the project, then use in code:
---- await TextCopy.ClipboardService.SetTextAsync("text-to-copy-to-clipboard"));
- Add non-essential code pages
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
- Read a connection string from a config file
var builder = new ConfigurationBuilder().AddJsonFile("appsettings.json", optional: false);
string connectionString = builder.Build().GetConnectionString("ConnectionStringName");
- Add non-essential code pages
var contextOptions = new DbContextOptionsBuilder<MyDbContextClassName>().UseSqlServer(connectionString).Options;
using (var dbx = new MyDbContextClassName(contextOptions)) { ... }
< - Passing lambdas to a method
RegularExpressions
Print Formatting
- Convert a decimal value with a culturally appropriate format
Dim culture As CultureInfo = CultureInfo.CreateSpecificCulture("hr-HR")
Dim destinationVariable as decimal
If Decimal.TryParse(decimalStringText, Globalization.NumberStyles.Number, culture, destinationVariable) = False Then
// error
End If
- Parse a DateTime string
CultureInfo enUS = new CultureInfo("en-US");
DateTimeStyles noStyle = DateTimeStyles.None;
DateTime t1, t2;
string f = "yyyyMMddHHmmss";
if (!DateTime.TryParseExact(t1string, f, enUS, noStyle, out t1)) t1 = DateTime.MinValue;
if (!DateTime.TryParseExact(t2string, f, enUS, noStyle, out t2)) t2 = DateTime.MinValue;
// return date plus two times
return string.Format("{0:yyyy-MM-dd} {0:HH:mm}-{1:HH:mm}", t1, t2)
Collections & Sorting
VB.NET 2010
Constants, Literals and Collection initialization
Enums
Basic I/O
Entity framework
XML in VB.NET
Processes, delegates, threads and timing
Mail, Zip...
Other
Referentni materijali:
-
ISO popis zemalja¸
- Sadržaj
autoexec.bat i config.sys datoteka, vezano za narodne znakove
- Popis Excel 2000 funkcija:
- po
kategorijama
(Excel),
- po
abecedi (Excel),
- po
abecedi (Word, podobno za ispis na
jedan list papira, ako možete printati "2 na 1" i dvostrano)
|
Microsoft
Savjeti za rad s Windowsima, Office-om i sve ostalo....
- SLINT (for Rust, C++, NodeJS)
- How to remove website permission for notifications?
Open: (copy the link to the address bar):
chrome://settings/content/notifications
- GMail advanced search
- Outlook advanced search
- Free Movies Online
- Free AudioBooks Online
- pisanje zareza uz veznike
- Testing OIBs, JMBGs and JMBAGs
- Various MS hints
- Dekanova odluka o OIB-u
- izdavanje-OIB-a-za-strane-fizicke-osobe.docx
- 80+ Cool Microsoft Interview Questions
- Process Viewer - a good one with a lot of information shown
- TrayIt - a program that enables minimization to a System Tray (aka an Icon Notification Area)
- How To: Protect Forms Authentication in ASP.NET 2.0
- Setting up SSL correctly with IIS and ASP.NET
- PChuck's Network: Local Name and Address Resolution On Your Computer
- PChuck's Network: Address Resolution on the LAN
- MIX 2010 Session Schedule
- Ten Google Services to Help Your Ecommerce Business
- VS Mag: Practical ASP.NET: Customizing the Login Control
- Ručna autentikacija za ASP.NET
- Daljinar za RH
- Microsoft Certified IT Professional Certifications
- Microsoft Certified Professional Developer Certifications
- Microsoft Certified Technology Specialist Certifications
- Navigate The .NET Framework And Your Projects With The My Namespace
- Craft A Rich UI For Your .NET App With Enhanced Windows Forms Support
- An Overview Of The New Services, Controls, And Features In ASP.NET 2.0
- Windows Shell Context Menus
- činidba dvoprjedmetniqa
- Postupak za podešavanje 'default domene'
- Consumer Publications of US Federal Communications Commission (jest da je američko, ali mnoge stvari vezane za telekomunikacije su iste)
- Zašto izbjegavam kvačice u e-mailu
- WindowsXP Guides (korisne informacije)
- Kako automatski učitati istu ili drugu web stranicu?
- Počeli su radovi na novoj knjižnici
- Popis kratica na tipkovnici (engleski) - Windows, IE, Office...
- Opći oblik telefonskoga broja (MS, FCC)
- Dijeljene mape na Windowsima 95/98/Me
- POP3 locking mechanism
- Struktura e-mail adrese
- Autologin na Windows XP
- Podešavanje parametara za e-mail program
- CARNet CERT: Prikaz kaznenog zakonodavstva s područja kompjutorskog kriminaliteta
- Isključivanje blokiranja pristupa prilozima u e-mailu za Outlook 2000+
- Windowsi i Office bez miša (.ppt, .pdf)
- Kombinacije tipki za PowerPoint (.doc)
- PowerPoint text-scraping function
- PowerPoint images import function
- Opening File Explorer on a given folder
- Explore.exe "C:\users"
- Explore.exe /root, "C:\users"
- Explore.exe /select, "C:\users"
character tables
EXCEL
Outlook
MAUI
SHELL EXTENSIONS
LINQ
- Query expression basics
- group clause (C# Reference)
- LINQ @ Wikipedia
- LINQ Method Syntax (FluentAPI)
- Standard LINQ Query Operators
- Filtering - Where, OfType
- Sorting - OrderBy, OrderByDescending, ThenBy, ThenByDescending, Reverse
- Grouping - GroupBy, ToLookup
- Join - GroupJoin, Join
- Projection - Select, SelectMany
- Aggregation - Aggregate, Average, Count, LongCount, Max, Min, Sum
- Quantifiers - All, Any, Contains
- Elements - ElementAt, ElementAtOrDefault, First, FirstOrDefault, Last, LastOrDefault, Single, SingleOrDefault
- Set - Distinct, Except, Intersect, Union
- Partitioning - Skip, SkipWhile, Take, TakeWhile
- Concatenation - Concat
- Equality - SequenceEqual
- Generation - DefaultEmpty, Empty, Range, Repeat
- Conversion - AsEnumerable, AsQueryable, Cast, ToArray, ToDictionary, ToList
- Sum of squares
Console.WriteLine(
Enumerable.Range(1, 10)
.Where(x => x % 2 == 0)
.Select(x => x * x)
.Aggregate(0, (sum, x) => sum + x)
); // Output: 220
- Group to odd and even numbers
foreach (var group in Enumerable.Range(1, 10).GroupBy(x => x % 2).OrderBy(x => x.Key))
{
Console.WriteLine(group.Key == 0 ? "EVEN" : "ODD");
foreach (var item in group) { Console.WriteLine(" " + item); }
}
SQL
*[iu]x
Exchange
Git
devtut.github.io
- devtut.github.io/
- git
- Creating a personal access token
- PowerShell
- PSGitHub module
- Getting Github collaborators
Get-GithubRepository -AccessToken <YOUR_github_access_token> | Select-Object -First 3 | ForEach {
# you might have access to other pepople's repositories but you lack permission to reach their collaborators list, so...
if ($_.full_name.StartsWith("<YOUR_github_login>")) {
$colaborators = $_ | Get-GitHubRepositoryCollaborator -AccessToken <YOUR_github_access_token>
echo "$($_.Name)#$($colaborators.login)" }}
- .NET Framework
- C#
- Visual Basic .NET
PowerShell
- The basics of PowerShell scripting
- PowerShell for Beginners (1-13)
- VisualBasic.NET code in PowerShell script
- Elevated powershell from WSL:
powershell.exe -Command "Start-Process powershell -Verb RunAs"
- Ensure that script is run by an elevated powershell process
#include the following Requires comment line at the start of the script
#Requires -RunAsAdministrator
- Console input/output
$Server = Read-Host -Prompt 'Input your server name'
$User = Read-Host -Prompt 'Input the user name'
$Password = Read-Host -Prompt 'Input the user password' -AsSecureString
$Date = Get-Date
Write-Host "You input server '$Server' and '$User' on '$Date'"
Write-Output "You input server '$Server' and '$User' on '$Date'"
- Execute a command in a string
$cmd = "dir *.ps1"
Invoke-Expression $cmd
- Convert a string of commands into a scriptblock
$cmd = @"
a multiline set of commands
"@
$scriptBlock = [Scriptblock]::Create($cmd)
Invoke-Command -ScriptBlock $scriptBlock
- PowerShell scheduled job
# from an Administrator PowerShell
$trigger = New-JobTrigger -Once -At ((Get-Date).AddSeconds(5)) -RepeatIndefinitely -RepetitionInterval (New-TimeSpan -Minutes 1)
Register-ScheduledJob -Name "EveryMinuter" -Trigger $trigger -ScriptBlock { whoami }
# Get-Job, Receive-Job, Remove-Job, Unregister-ScheduledJob
- Change local user password
$Password = Read-Host -AsSecureString -Prompt "Enter new password"
Get-LocalUser -Name <username> | Set-LocalUser -Password $Password
- Outlook attachments via PowerShell
- Accessing Outlook Inbox messages from Powershell
Add-Type -Assembly "Microsoft.Office.Interop.Outlook"
$Outlook = New-Object -ComObject Outlook.Application
$namespace = $Outlook.GetNameSpace("MAPI")
$inbox = $namespace.GetDefaultFolder([Microsoft.Office.Interop.Outlook.OlDefaultFolders]::olFolderInbox)
$inbox.Items | foreach {
"{0:yyyy-MM-dd HH:mm}#{1:n0}#{2}#{3}" -f $_.ReceivedTime, $($_.Size / 1024), $_.SenderEmailAddress, $_.Subject
}
- Inspect the MS SQL Server database
sqlps -noexit -command cd sql/<machineName>/<instanceName>/databases
dir <databaseName>/tables | foreach { $_.Script() }
dir <databaseName>/storedProcedures | foreach { $_.Script() }
dir <databaseName>/tables/dbo.<tableName>/columns |
foreach {
"Column: $($_.name) $($_.datatype.SqlDataType) $($_.datatype.MaximumLength) $($_.Nullable)"
}
- Get Target Path from Shortcuts
- Securng Passwords
- PowerShell Massive Mailing
- Invoke-WebRequest cmdlet in PowerShell
- Prebroj programske linije
- Find PDF files with 'python' in the name (case insensitive)
Get-ChildItem c:\,d:\ -Recurse -ErrorAction SilentlyContinue | where name -like "*python*pdf"
- Massive filename deyusciification
dir | foreach {
$name = $_.name
$newName = $name.Replace("ć", "c").Replace("č", "c").Replace("š", "s").Replace("ž", "z").Replace("đ", "dj")
$newName = $newname.Replace("Ć", "C").Replace("Č", "C").Replace("Š", "S").Replace("Ž", "Z").Replace("Đ", "DJ")
if ($name -ne $newName) {
"mv $name $newName"
#mv $name $newName
}
}
- List parents of folders listed in a file by creation date
cat <fielNamesListFileName> | foreach {
$gitFile = [System.IO.DirectoryInfo]$_
$gitfile.Parent
} | sort lastwritetime | foreach {
"{0:yyyy-MM-dd} {1}" -f $_.lastwritetime, $_.fullname
}
Markdown
Pandoc
Cartificates
Web
Ostalo
|