Skip to content

Instantly share code, notes, and snippets.

View smdooley's full-sized avatar

Sean Dooley smdooley

View GitHub Profile
@smdooley
smdooley / jquery.ua-events.js
Created May 16, 2022 09:03
Google Analytics events for all a tags
jQuery(document).ready(function ($) {
var filetypes = /\.(zip|exe|pdf|doc*|xls*|ppt*|mp3)$/i;
var baseHref = '';
if (jQuery('base').attr('href') != undefined) {
baseHref = jQuery('base').attr('href');
$('a').each(function() {
var href = $(this).attr('href');
if (href && (href.match(/^https?\:/i)) && (!href.match(document.domain))) {
$(this).click(function() {
var extLink = href.replace(/^https?\:\/\//i, '');
@smdooley
smdooley / README.md
Created April 29, 2022 19:52
Phaser vite.js setup

Install vite.js vanilla-ts template

npm init vite@latest [folder name] -- --template vanilla-ts

Run the project

cd [folder name]
@smdooley
smdooley / readme.md
Created December 7, 2021 17:03
Github | Tips
git log --oneline --no-merges 1.7.8..1.7.9
git log --pretty=format:"%h%x09%an%x09%ad%x09%s"
git log --pretty=format:"%h%x09%an%x09%ad%x09%s" > log.txt
@smdooley
smdooley / AuthorizeAttributes.cs
Created June 17, 2021 10:19
Custom Authorize Attribute
protected virtual bool AuthorizeCore(HttpContextBase httpContext)
{
if (httpContext == null)
{
throw new ArgumentNullException("httpContext");
}
IPrincipal user = httpContext.User;
if (!user.Identity.IsAuthenticated)
{
@smdooley
smdooley / editor.controller.js
Created April 22, 2020 12:42
Umbraco Thumbnail Property Editor
angular
.module("umbraco")
.controller("ThumbnailMultiPicker.PropertyEditor.Controller", function ($scope, $timeout) {
$scope.init = function () {
$scope.options = [
{
alias: "smartphone",
image: "/App_Plugins/ThumbnailMultiPicker/assets/images/iconmonstr-smartphone-3-240.png",
selected: true
@smdooley
smdooley / package.manifest
Created July 19, 2018 15:09
Umbraco Package Manifest
{
"title": "A schema for Umbraco's package.manifest files.",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"definitions": {
"editor": {
"description": "This describes details about the editor",
"type": "object",
"additionalProperties": false,
"properties": {
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Mail;
using System.Threading.Tasks;
using DnsClient;
using Microsoft.VisualBasic.FileIO;
namespace EmailVerification
Feature / Release
git checkout -b develop
git checkout -b feature_branch
# a bunch of work is done on the features
git checkout -b develop
git merge feature_branch
git branch -D feature_branch
@smdooley
smdooley / MediaController.cs
Last active January 19, 2017 09:25
Umbraco Protect Media
using System;
using System.IO;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
namespace App_Code.Controllers