Skip to content

Instantly share code, notes, and snippets.

@jamescoxhead
jamescoxhead / Regex.txt
Created March 16, 2016 17:05
Common Regexes
Vimeo URL - ^https?:\/\/(?:www\.|player\.)?vimeo\.com/(\d+)$
@jamescoxhead
jamescoxhead / PurgeCloudflare.ps1
Created November 15, 2017 12:04
Purges the Cloudflare cache. Assumes variables are stored as environment variables
# Get parameters
$cloudflareApiKey = $Env:CloudflareApiKey
$cloudflareEmail = $Env:CloudflareEmail
$cloudflareZoneId = $Env:CloudflareZoneId
# Build the request
$endpoint = "https://api.cloudflare.com/client/v4/zones/$cloudflareZoneId/purge_cache"
$headers = @{"X-Auth-Key" = $cloudflareApiKey; "X-Auth-Email" = $cloudflareEmail; "Content-Type" = "application/json"}
$body = "{'purge_everything': true}"
@jamescoxhead
jamescoxhead / .editorconfig
Last active October 7, 2019 13:01
Sample editor config
root = true
[*]
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
charset = utf-8
[*.{xml,proj,nuspec}]
@jamescoxhead
jamescoxhead / NodeDocumentTypes.sql
Created April 16, 2019 14:54
Lists Umbraco content and media nodes and their corresponding document type alias
SELECT C.nodeId, CT.alias, N.text FROM cmsContent C
INNER JOIN cmsContentType CT ON C.contentType = CT.nodeId
INNER JOIN umbracoNode N ON C.nodeId = N.id