Skip to content

Instantly share code, notes, and snippets.

@alirobe
alirobe / export-umbraco-redirects-for-seochecker.sql
Last active May 19, 2022 21:10
How to Migrate Umbraco Redirects into SEOChecker
SELECT replace(umbracoRedirectUrl.url, '1075/', '') as url
,umbracoNode.id
,umbracoRedirectUrl.contentKey
FROM umbracoRedirectUrl
INNER JOIN umbracoNode on umbracoRedirectUrl.contentKey = umbracoNode.uniqueID
# Run in SSMS, right click results and export to CSV. Import CSV to SEOChecker.
# NB replace 1075 with your root node ID
@mdowst
mdowst / Search-PSScripts.ps1
Last active November 29, 2018 20:53
A PowerShell function usedto search the text inside PowerShell scripts for a particular string
Function Search-PSScripts{
<#
.SYNOPSIS
Use to search the text inside PowerShell scripts for a particular string
.PARAMETER SearchString
The string to search for inside the script file
.PARAMETER Path
The folder path to search for PowerShell files in. Default to userprofile if not specified.
@nissan
nissan / new-dotnetcore-react-ts-storybook-jest.ps1
Created June 2, 2018 22:00
Setup a new .NET Core 2.1 app for Windows with React, TypeScript, Storybook, Jest
Assumes you have the .NET SDK 2.1 for Windows already installed
#Use Chocolatey to install packages, run this script from Administrator Powershell
Set-ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
#Use nvm to manage node versions
choco install -y nvm
nvm use default
#install yarn independent of version of node being used
choco install -y yarn
refreshenv
@aquasmit
aquasmit / tripadvisor-scraping.js
Created April 6, 2016 16:28
TripAdvisor Reviews Scraping using X-Ray (Node.js)
var Xray = require('x-ray');
var x = Xray();
x('https://www.tripadvisor.com/Hotel_Review-g60763-d93545-Reviews-The_Manhattan_at_Times_Square_Hotel-New_York_City_New_York.html', '#REVIEWS .reviewSelector', [{
reviewer: '.username.mo span',
//ajax_link:'div#most_recent_pager div .pam.uiBoxWhite.noborder.uiMorePagerPrimary@href'
reviewer_location: '.location',
//review_rating: '.rating-very-large meta[content]@content',
//review_date: '.rating-qualifier [content]@content',
@msubel
msubel / uuid_v4_excel_formula.txt
Created July 14, 2015 12:37
An Excel Fromula to generate a UUID v4
=LOWER(CONCATENATE(DEC2HEX(RANDBETWEEN(0;POWER(16;8));8);"-";DEC2HEX(RANDBETWEEN(0;POWER(16;4));4);"-";"4";DEC2HEX(RANDBETWEEN(0;POWER(16;3));3);"-";DEC2HEX(RANDBETWEEN(8;11));DEC2HEX(RANDBETWEEN(0;POWER(16;3));3);"-";DEC2HEX(RANDBETWEEN(0;POWER(16;8));8);DEC2HEX(RANDBETWEEN(0;POWER(16;4));4)))
@erikzrekz
erikzrekz / zendesk-hc-template-and-components-doc.md
Last active April 26, 2022 17:08
Zendesk Help Center Template and Components Documenation

The help center has a series of HTML templates with accompanying components. I put this together to brief myself on the available features within a help center. The official documentation can be found here

Table of Contents

  • Header
  • Footer
  • Home
  • Category
  • Section
  • Article
  • Contribution
workflow AutoShutdownWorkflow
{
#$VerbosePreference = "continue"
# Automation Settings
$pscreds = Get-AutomationPSCredential -Name "runbook-account"
$subscriptionName = "[subscription name here]"
$tagName = "autoShutdown"
# Authenticate using WAAD credentials
@vsouza
vsouza / .bashrc
Last active September 21, 2024 12:31
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@troyhunt
troyhunt / DeleteAzureResources.ps1
Created January 22, 2015 13:14
This one removes all the components I normally create for an Azure website
# Input params
$projectName = "TroyPSTest"
# Constants
$dbServerName = "snyb5o1pxk"
$dbServerLogin = "troyhunt"
$dbServerPassword = "P@ssw0rd"
$apiVersion = "2014-04-01"
# Computed vars
@troyhunt
troyhunt / CreateAzureResources.ps1
Created January 22, 2015 13:12
Full script for provisioning all the resources I typically use for a new Azure website and database back end
# Per project params
$projectName = "TroyPSTest"
$hostName = "troypstest.troyhunt.com"
# Environment constants
$location = "West US"
$webResourceGroup = "Default-Web-WestUS"
$webHostingPlan = "DefaultServerFarm"
$dbResourceGroup = "Default-SQL-WestUS"
$dbServerName = "snyb5o1pxk"