Skip to content

Instantly share code, notes, and snippets.

@vadimblv
vadimblv / Remove-Binding-Redirect.ps1
Created October 10, 2022 06:29
Remove-Binding-Redirect
# https://martowen.com/2018/09/12/refreshing-net-assembly-binding-redirects-in-a-visual-studio-solution/
function Remove-BindingRedirect {
param(
[parameter(Mandatory=$true, ValueFromPipeline=$true)]
[object[]]
$Project
)
process {
$ProjectDir = Split-Path $Project.FullName
$ConfigFileName = $Project.ProjectItems | Where-Object { $_.Name -eq 'web.config' -or $_.Name -eq 'app.config' -or $_.Name -eq 'App.config' -or $_.Name -eq 'App.Master.config' -or $_.Name -eq 'Web.Master.config' }
@vadimblv
vadimblv / ConnectionString.sql
Last active February 23, 2023 13:06
Get connection string from ms sql database
select
'data source=' + @@servername +
';initial catalog=' + db_name() +
case type_desc
when 'WINDOWS_LOGIN'
then ';trusted_connection=true;MultipleActiveResultSets=true'
else
';user id=' + suser_name() + ';password=<<YourPassword>>;'
end
as ConnectionString
@vadimblv
vadimblv / UITableViewIntoPDF.m
Last active May 19, 2025 02:23
Rendering UITableView into PDF
@implementation UITableViewIntoPDF
+ (NSData*)pdfDataWithTableView:(UITableView*)tableView {
UIGraphicsBeginImageContextWithOptions(tableView.contentSize, NO, 0);
[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
atScrollPosition:UITableViewScrollPositionTop animated:NO];
[tableView.layer renderInContext:UIGraphicsGetCurrentContext()];
int iterationCount = ceil(tableView.contentSize.height / tableView.bounds.size.height);