Skip to content

Instantly share code, notes, and snippets.

Stuck in vim

Niels Swimberghe Swimburger

Stuck in vim
Block or report user

Report or block Swimburger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SampleResponsive.html
<source srcset="/media/bdpjq2s3/umbracologolarge.png?mode=pad&width=420" media="(max-width: 480px)" sizes="420px" />
<source srcset="/media/bdpjq2s3/umbracologolarge.png?mode=pad&width=720" media="(max-width: 768px)" sizes="720px" />
<source srcset="/media/bdpjq2s3/umbracologolarge.png?mode=pad&width=960" sizes="960px" />
<img src="/media/bdpjq2s3/umbracologolarge.png" alt="Umbraco logo" />
Swimburger / SeleniumHeadlessChromeDriver.cs
Last active Jul 25, 2019
C# instantiate ChromeDriver in headless mode
View SeleniumHeadlessChromeDriver.cs
var options = new ChromeOptions();
using(var driver = new ChromeDriver(".", options)){
View RemoveLogFiles.ps1
$LogFolder = "D:\home\site\wwwroot\App_Data\Logs";
$DaysToKeepLogsAround = 30;
Get-ChildItem -Path $LogFolder -Recurse -File | Where LastWriteTime -lt (Get-Date).AddDays(-$DaysToKeepLogsAround) | Remove-Item -Force
View GetFolderSizes.ps1
Get-ChildItem -Directory | ForEach {$_.FullName + (" {0:N2} MB" -f ((Get-ChildItem $_.FullName -Recurse | Measure-Object -Property Length -Sum).Sum / 1MB))}
View AddAvailabilityRestrictedIPApp.ps1
[Parameter(Mandatory = $true)]
[string] $ResourceGroupName,
[Parameter(Mandatory = $true)]
[string] $AppServiceName,
[Parameter(Mandatory = $true)]
[string] $SubscriptionId,
[Parameter(Mandatory = $true)]
[string] $RulePriority
View PurgeCloudflareCache.ps1
Function PurgeAllCloudflareCache{
[string] $AdminEmail,
[string] $ApiKey,
[string] $ZoneId
View CrawlSitemap.ps1
Function CrawlSitemap
[string] $SiteMapUrl
$SiteMapXml = Invoke-WebRequest -Uri $SiteMapUrl -UseBasicParsing -TimeoutSec 180;
$Urls = ([xml]$SiteMapXml).urlset.ChildNodes
ForEach ($Url in $Urls){
Swimburger / CrawlSite.ps1
Last active Jan 25, 2019
Crawl your website links and images to find broken links/images using PowerShell
View CrawlSite.ps1
[string] $Url,
[int] $MaxPages,
[bool] $IncludeImages = $true,
[bool] $StayOnDomain = $true,
[bool] $IgnoreFragments = $true)
$Domain = [Uri]::new($Url).Host;
Swimburger / Robots.chtml
Last active Sep 20, 2019
Dynamic Robots.cshtml robots.txt file for Umbraco, learn more at
View Robots.chtml
@inherits UmbracoTemplatePage
Layout = null;
var rootUrl = Request.Url.GetLeftPart(UriPartial.Authority);
}Sitemap: @string.Format("{0}{1}", rootUrl, "/sitemap.xml")
User-agent: *
Disallow: /umbraco
Swimburger / robots.txt
Created Oct 10, 2018
Robots.txt example with sitemap
View robots.txt
User-agent: *
Disallow: /umbraco
You can’t perform that action at this time.