Skip to content

Instantly share code, notes, and snippets.

@bradchristie-velir
bradchristie-velir / FixOrphans.sql
Created March 11, 2021 18:32
Fix orphaned SQL logins
SET NOCOUNT ON
USE [database_name]
GO
DECLARE @loop INT
DECLARE @USER sysname
DECLARE @sqlcmd NVARCHAR(500) = ''
IF OBJECT_ID('tempdb..#Orphaned') IS NOT NULL
BEGIN
@Gimly
Gimly / azure-pipeline.yml
Last active March 21, 2024 14:50
A sample azure pipeline that creates a nuget package and publish it to Azure DevOps artifacts
trigger:
- master
pool: 'Hosted Windows 2019 with VS2019'
variables:
buildConfiguration: 'Release'
stages:
- stage: build_pack
@camieleggermont
camieleggermont / UpdateIISExpressCertificate.ps1
Last active May 22, 2024 09:08
This powershell script generates a new certificate, removes the old certificate assignments from the IISExpress ssl ports and adds the newly generated one. The certificate is also copied over to the Trusted Root Certificate Authorities.
$cert = New-SelfSignedCertificate -DnsName "localhost", "localhost" -CertStoreLocation "cert:\LocalMachine\My" -NotAfter (Get-Date).AddYears(5)
$thumb = $cert.GetCertHashString()
For ($i=44300; $i -le 44399; $i++) {
netsh http delete sslcert ipport=0.0.0.0:$i
}
For ($i=44300; $i -le 44399; $i++) {
netsh http add sslcert ipport=0.0.0.0:$i certhash=$thumb appid=`{214124cd-d05b-4309-9af9-9caa44b2b74a`}
}
@apisandipas
apisandipas / share-urls.md
Last active September 22, 2024 11:29 — forked from chrisjlee/drupal-views-share-global-text-field
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@naepalm
naepalm / Pagination.cshtml
Last active December 22, 2021 12:29
A "quick & easy" razor pagination to plug into an Umbraco View, Partial View, or Macro
@{
var pageSize = 8;
if(Model.Content.HasValue("numberOfItemsPerPage")){
pageSize = Model.Content.GetPropertyValue<int>("numberOfItemsPerPage");}
var page = 1; int.TryParse(Request.QueryString["page"], out page);
var items = Umbraco.TypedContent(Model.Content.Id).Children.Where(x => x.DocumentTypeAlias == "exampleAlias" && x.IsVisible()).OrderByDescending(x => x.CreateDate);
var totalPages = (int)Math.Ceiling((double)items.Count() / (double)pageSize);
if (page > totalPages)