Skip to content

Instantly share code, notes, and snippets.

View madsoulswe's full-sized avatar
💯
I may be slow to respond.

Dennis Öhman madsoulswe

💯
I may be slow to respond.
View GitHub Profile
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
Import-Module -Name Terminal-Icons
Import-Module oh-my-posh
@madsoulswe
madsoulswe / git_rebase.md
Created January 14, 2019 09:48 — forked from ravibhure/git_rebase.md
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@madsoulswe
madsoulswe / MultiNodeTreePickerIdToUdiMigrator.cs
Created August 20, 2018 12:51
Migrate Ids to Udis for Umbraco.MultiNodeTreePicker
using System;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Web;
namespace Sniper.Umbraco
{
public static class MultiNodeTreePickerIdToUdiMigrator
{
@madsoulswe
madsoulswe / umbraco db cleanup.sql
Created January 10, 2018 13:51 — forked from dampee/umbraco db cleanup.sql
Umbraco Database cleanup. After pulling in an umbraco database from production, you don't need all history or log.
-- Umbraco Clear Old Document Versions To Decrease Database Size And Improve Performance
-- http://borism.net/2008/12/16/fixing-a-large-cmspropertydata-table-in-umbraco/
DECLARE @createdDate Datetime = DATEADD(m, -1, getdate())
-- dump logs
-- TRUNCATE TABLE umbracolog -- faster if log table is very big and you don't need anything
DELETE FROM umbracolog WHERE Datestamp < @createdDate
-- clean up old versions
DELETE FROM cmsPropertyData WHERE