Skip to content

Instantly share code, notes, and snippets.

View mrflo's full-sized avatar
👋
Trying new ideas

Florent Grandjean mrflo

👋
Trying new ideas
View GitHub Profile
@mrflo
mrflo / ba.sh
Last active December 11, 2018 08:10 — forked from bvolpato/ba.sh
Install Chrome Driver with Xvfb (Debian Server)
#!/bin/bash
sudo apt-get update
sudo apt-get install fonts-liberation xdg-utils libxss1 libappindicator1 libindicator7 unzip default-jdk
# Chrome Repo
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
@mrflo
mrflo / SlimsyIt.cshtml
Last active May 29, 2022 10:13
Simple partial view to simulate Slimsy on Umbraco V9 - a simple Slimsy simulator and the example to use it. This is used mainly when you migrate a V7/8 to a 9th version
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@using Umbraco.Cms.Core.Media
@using Umbraco.Cms.Core.Routing
@using System.Web;
@using System.Text
@inject IPublishedValueFallback PublishedValueFallback
@inject IPublishedUrlProvider PublishedUrlProvider
@inject IImageUrlGenerator ImageUrlGenerator
@{ //Slimsy simulator
@mrflo
mrflo / XmlSitemap.cshtml
Created May 30, 2022 08:26
Simple XML SiteMap for Umbraco 9
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@{ Layout = null;
Context.Response.ContentType = "text/xml";
}
<?xml version="1.0" encoding="UTF-8" ?>
@{ var selection = Model.Root(); }
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>@Model.Parent.Url()</loc>
<changefreq>monthly</changefreq>
@mrflo
mrflo / MultiNodeTreePickerIdToUdiMigrator.cs
Created August 17, 2022 09:48
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
{
@mrflo
mrflo / UIDMigrator.cs
Last active September 5, 2022 19:06
Umbraco Migrate Media Picker ID to UdI including OP10 pickers. Two methods to be called on startup event. One is to migrate MediaPicker from classic Document Type and the other one is to update all nested content sub properties.
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Web;
namespace Migrator
{
@mrflo
mrflo / gist:183f4bfd5d7eac32b3ca1cbefe3a0585
Created September 26, 2022 11:24 — forked from johanmeiring/gist:3002458
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@mrflo
mrflo / gist:e80936606db99bc588ceb6cc387ae9bc
Created October 7, 2022 13:40
Insert into icUrlTracker all url from umbracoRedirectUrl table - Allow you to use 301 urlTracker plugin
Insert into icUrlTracker
(OldUrl,RedirectNodeId,Is404,inserted)
SELECT
url
,SUBSTRING([url], 5,LEN(url)) as RedirectNodeId
,LEFT([url]
,4)as OldUrl
,0
,[createDateUtc] as inserted
FROM [umbracoRedirectUrl]
@mrflo
mrflo / change-scheme-owner.sql
Created October 16, 2022 06:43
Change SQL schema owner back to dbo : run this query on your database then copy paste and execute the result
SELECT 'ALTER SCHEMA dbo TRANSFER ' + SCHEMA_NAME(schema_id) + '.' + name
FROM sys.tables
WHERE schema_id != SCHEMA_ID('dbo');