Skip to content

Instantly share code, notes, and snippets.

View JamesSkemp's full-sized avatar

James Skemp JamesSkemp

View GitHub Profile
@JamesSkemp
JamesSkemp / Search Files with Git Grep.ps1
Last active January 29, 2020 19:47
Use built-in Windows functionality to find a string of text in a directory.
# Can only be run within a Git repository, but this will also search untracked files, as well as those that are tracked.
git grep --untracked '<term>'
@JamesSkemp
JamesSkemp / Application Settings.md
Created August 24, 2017 00:12
Visual Studio Code Settings

Application Settings

Extensions

  • Add jsdoc comments
  • C#
  • C# XML Documentation
  • Cordova Tools
  • PowerShell
  • seti-icons
@JamesSkemp
JamesSkemp / CREATE VIEW.sql
Last active August 18, 2017 21:12
T-SQL templates
CREATE VIEW authorizer.ElevatedUserSiteRoles
AS
/*
DESCRIPTION: Used to display all elevated users with their specific site roles.
CALLED BY: SSMS.
*/
SELECT u.Id AS UserId, u.NetId, u.Added, u.SiteId, s.WiscWebId, s.Name AS SiteName, s.Url, s.DefaultRole, s.RequireWsb, u.RoleId, r.Name AS RoleName, r.[Description]
FROM authorizer.ElevatedUser u
LEFT JOIN authorizer.WiscWebSite s ON u.SiteId = s.Id
LEFT JOIN authorizer.AccessRole r ON u.RoleId = r.Id
@JamesSkemp
JamesSkemp / Distinctive Emails.md
Created May 17, 2017 17:09
LINQPad query to take a listing of emails, with some items containing comma-delimited list of emails, and finds distinct ones.

Move files into a subdirectory, Mac OS X.

for f in *.32x; do mv "$f" 32X; done

Mac OS X

A 7-zip clone can be installed via brew.

brew install p7zip

Extract all **.7z archives in a directory, keeping paths

for file in *.7z; do 7z x "$file"; done

Extract all **.7z archives to a subdirectory, keeping paths

@JamesSkemp
JamesSkemp / Convert Sitecore Web forms sublayout to Helix and MVC.md
Last active October 17, 2017 16:08
Rough notes on converting a Sitecore Web forms sublayout to MVC and Helix.

Background

We currently have a Visual Studio solution with two projects: one for our main site, using Web forms, and one for utilities, which is currently Extension methods on Item. (The latter project has been in the queue to migrate to a NuGet package on our local NuGet server.)

Running Sitecore 8.1.160519.

Initial setups

  1. Add solution folders to the existing project.
    1. Configuration
    2. Feature
    3. Foundation
@JamesSkemp
JamesSkemp / Reinstall VS 2015 with Update 2.bat
Created November 3, 2016 13:02
Reinstall VS 2015 with Update 2
REM Must point to the installer. In this case it was the full installer.
REM From https://msdn.microsoft.com/en-us/library/mt653628.aspx
vs_professional.exe /OverrideFeedURI http://download.microsoft.com/download/0/6/B/06BB0C5C-C767-4250-91DA-AB463377597E/20160405.3/enu/feed.xml
@JamesSkemp
JamesSkemp / Mac OS dev setup.md
Last active August 15, 2021 21:00
Steps working with Mac OS for development
  1. Install Visual Studio Code.
  2. Install iTerm2.
    • Activate gitfast plugin.
      • vi ~/.zshrc and add gitfast on plugins line.
  3. Setup SSH key for git.
    • ssh-keygen -t rsa
    • pbcopy < ~/.ssh/id_rsa.pub
  4. Turn on hidden files in Finder
    • defaults write com.apple.finder AppleShowAllFiles YES
    • Hold the 'Option/alt' key, then right click on the Finder icon in the dock and click Relaunch.
@JamesSkemp
JamesSkemp / SwitchMasterToWeb.config.example.pubxml
Created October 20, 2016 18:02
Visual Studio publishing profile example for SwitchMasterToWeb.config.example rename
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>C:\path\to\publish</publishUrl>