Skip to content

Instantly share code, notes, and snippets.

View brendan-rice's full-sized avatar

Brendan Rice brendan-rice

View GitHub Profile
@davidfowl
davidfowl / dotnetlayout.md
Last active May 15, 2024 07:06
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@adamjohnson
adamjohnson / publickey-git-error.markdown
Last active May 10, 2024 10: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
@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$" />
@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
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@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",
@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" />
@rarous
rarous / Deploy.ps1
Created September 14, 2010 14:06
Script for packaging and deployment of ASP.NET applications to IIS via Web Deploment Tools
Properties {
$Build_dir = Split-Path $psake.build_script_file
$Packages_dir = Join-Path $build_dir 'Packages'
$MsDeploy_dir = Join-Path $env:ProgramFiles 'IIS\Microsoft Web Deploy'
$SiteName = 'www.example.com'
$Package = "$SiteName.zip"
$Dest = 'hosting.com'
$UserName = 'IIS User Name'
$Pwd = 'Secret Password'
@SidShetye
SidShetye / StripeWebhookController.cs
Created October 25, 2012 04:36
Receiving Stripe.com's Webhooks in ASP.NET C#, MVC4
using System;
using System.IO;
using System.Web;
using System.Web.Mvc;
using Stripe; // you need this library https://github.com/jaymedavis/stripe.net
using System.Net;
namespace StripeSampleMVC.Controllers
{
public class StripeWebhookController : Controller
@hkirsman
hkirsman / mobtable.html
Created June 27, 2012 08:34
turn tables into mobile friendly
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="et">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>table</title>
<style type="text/css">
.odd { background-color: #808080; }
.generated_for_mobile { margin-bottom: 30px }