Skip to content

Instantly share code, notes, and snippets.

Brendan McKenzie brendanmckenzie

Block or report user

Report or block brendanmckenzie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brendanmckenzie
brendanmckenzie / backup-dbs.sql
Last active Mar 21, 2018
Sitecore 9 Installation
View backup-dbs.sql
backup database [SC90_Core] to disk = 'C:\\temp\\SC90_Core.bak';
backup database [SC90_EXM.Master] to disk = 'C:\\temp\\SC90_EXM.Master.bak';
backup database [SC90_ExperienceForms] to disk = 'C:\\temp\\SC90_ExperienceForms.bak';
backup database [SC90_Master] to disk = 'C:\\temp\\SC90_Master.bak';
backup database [SC90_Processing.Tasks] to disk = 'C:\\temp\\SC90_Processing.Tasks.bak';
backup database [SC90_Reporting] to disk = 'C:\\temp\\SC90_Reporting.bak';
backup database [SC90_Web] to disk = 'C:\\temp\\SC90_Web.bak';
backup database [SC90_MarketingAutomation] to disk = 'C:\\temp\\SC90_MarketingAutomation.bak';
backup database [SC90_Messaging] to disk = 'C:\\temp\\SC90_Messaging.bak';
backup database [SC90_Processing.Pools] to disk = 'C:\\temp\\SC90_Processing.Pools.bak';
View BasicProfiler.cs
internal sealed class BasicProfiler : IDisposable
{
readonly string _key;
readonly System.Diagnostics.Stopwatch _stopwatch;
public BasicProfiler(string key)
{
_key = key;
_stopwatch = new System.Diagnostics.Stopwatch();
_stopwatch.Start();
View kasbah-quickstart.md

Quick start

docker run --name kasbah_db -d -p '5432:5432' -e POSTGRES_PASSWORD=docker postgres:9.6
docker run --name kasbah_cache -d -p '6379:6379' redis

psql -h localhost -U postgres -c "create user kasbah with password 'kasbah'"
psql -h localhost -U postgres -c "create database kasbah with owner kasbah"

curl -o /tmp/kasbah_db.sql https://gist.githubusercontent.com/brendanmckenzie/7fc8d763f19ad69041b205f7eaea06c9/raw/865d36b30e18e2b8984930581e8a3166820c5689/kasbah_db.sql
psql -h localhost -U kasbah -f /tmp/kasbah_db.sql
View kasbah_db.sql
create table node (
id uuid primary key not null,
parent_id uuid references node ( id ),
type varchar(512) not null,
alias varchar(512) not null,
display_name text,
published_version_id integer,
View react-mount.js
import ReactDOM from 'react-dom'
import React from 'react'
import Templates from '../../../templates'
fetch('./data.json')
.then(res => res.json())
.then(res => {
const template = res.$template
if (template && template in Templates) {
var el = React.createElement(Templates[template], res)
View SiteConstraint.cs
using System.Web;
using System.Web.Routing;
namespace App.Constraints
{
public class SpecificSiteConstraint : IRouteConstraint
{
public bool Match
(
HttpContextBase httpContext,
View snapshot-volumes-cleanup.js
var AWS = require('aws-sdk');
AWS.config.region = 'ap-southeast-2';
exports.handler = function () {
var ec2 = new AWS.EC2();
var date = new Date().toISOString().substr(0, 10);
ec2.describeSnapshots({ Filters: [ { Name: 'tag-key', Values: [ 'Expires' ] }, { Name: 'tag-value', Values: [ date ] } ] }, function (err, data) {
if (err) {
View Contact.cs
namespace App
{
public class Contact
{
public object Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public string Phone { get; set; }
}
View Mvvm.Example.cs
class VenueDetailViewModel : MvvmModel
{
string _proprietor;
public string Proprietor { get { return _proprietor; } set { _proprietor = value; OnPropertyChanged(nameof(Proprietor)); } }
public string BusinessName { get; set; }
}
View Program.cs
using System;
using Npgsql;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Connecting to db...");
You can’t perform that action at this time.