Skip to content

Instantly share code, notes, and snippets.

View brendan-rice's full-sized avatar

Brendan Rice brendan-rice

View GitHub Profile
@warrenbuckley
warrenbuckley / BlogPost.cshtml
Created July 2, 2021 11:02
Automatically Generate Open Graph Social Images in Umbraco V9
@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.BlogPost>
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
@{
Layout = null;
}
<html>
<head>
<meta property="og:title" content="@Model.Header" />
@chrisfcarroll
chrisfcarroll / Install-EmptyUmbraco9.ps1
Last active July 2, 2021 20:04
Install-EmptyUmbraco9 for unattended install
#! /usr/bin/env pwsh
Param(
[string]$installerName="Installer",
[Parameter(Mandatory=$true)][string]$installerPassword,
[Parameter(Mandatory=$true)][ValidateScript(
{try{[System.Net.Mail.MailAddress]$_;return $true;}catch{return $false}})]
[string]$installerEmail,
[string]$dbServer=$env:SQLCMDSERVER,
[string]$dbDatabaseName="Umbraco",
@barryokane
barryokane / PatternLibRazorViewEngine.cs
Created March 11, 2017 04:56
Inspired by Heather Floyd's article (http://24days.in/umbraco-cms/2016/unique-sites-using-theming), however our use case is slightly different: we want to share a library of partials between multiple Umbraco sites with custom overrides on specific sites
using System.Linq;
using Umbraco.Web.Mvc;
namespace Endzone.Umbraco.PatternLib
{
public class PatternLibRazorViewEngine : RenderViewEngine
{
public PatternLibRazorViewEngine() : base()
{
/*
@ChesterCampbellAM
ChesterCampbellAM / ANestedContentUsePattern.txt
Last active October 24, 2018 16:44
Pattern for binding Nested Content content to strongly-typed models (via Models Builder) in Umbraco CMS v7.
This pattern has a couple of assumptions built in:
1) All nested content partial views will be saved in the directory: /Views/Partials/NestedContent
2) All nested content partials views will be named using the alias of the Document Type the
nested content is based on, but starting with an underscore. For example: Document Type
"Full Width Text Component" (alias = fullWidthTextComponent) should have a partial view
named "_FullWidthTextComponent.cshtml".
3) All Models Builder generated data models are namespaced to "AM.Models".
@ummahusla
ummahusla / git-overwrite-branch.sh
Last active February 25, 2024 00:06 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
@davidfowl
davidfowl / dotnetlayout.md
Last active May 5, 2024 11:47
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
.module {
some: stuff;
&__child {
blah: blah;
}
&--modifier {
modify: me;
}
}
@kipusoep
kipusoep / web.config.xml
Last active February 26, 2024 17:08
SEO redirects for web.config
<!-- SEO rules (from: http://www.seomoz.org/blog/what-every-seo-should-know-about-iis#chaining) -->
<!-- SEO | Section 1 | Whitelist -->
<rule name="Whitelist - Resources" stopProcessing="true">
<match url="^(?:css/|scripts/|images/|install/|config/|umbraco/|umbraco_client/|base/|webresource\.axd|scriptresource\.axd|__browserLink|[^/]*/arterySignalR/.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="None" />
</rule>
<!-- SEO | Section 2 | Rewrites (chaining) -->
<rule name="SEO - Remove default.aspx" stopProcessing="false">
<match url="(.*?)/?default\.aspx$" />

Website Contract [month] [year]

Description of this Contract

This contract is not meant to trick or deceive you; the intention is purely to protect both parties. I have tried to keep the wording as plain as possible, but if anything is unclear, please let me know and I will be more than happy to clarify it with you. Also, until you sign it, please feel free to request to change bits of it to suit your requirements.

In short, [client name] is contracting me, [my name], to [description of my role] between [start date and finish date].

By signing this, you are confirming that you have the power and ability to enter into this contract on behalf of [client's company].

@adamjohnson
adamjohnson / publickey-git-error.markdown
Last active April 18, 2024 01:00
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th