Skip to content

Instantly share code, notes, and snippets.

View JamesSkemp's full-sized avatar

James Skemp JamesSkemp

View GitHub Profile
@JamesSkemp
JamesSkemp / libGDX atlas file Kenney Roguelike Characters.md
Last active August 29, 2015 14:25
libGDX atlas file for Kenney's Roguelike Characters sprites

The following atlas file can be used by libGDX to reference sprites within Kenney's Roguelike Characters sheet.

Due to an issue with the spritesheet you'll need to:

  1. Move everything from the pants on (so everything but the two columns of people) over to the left one pixel. Based upon this Reddit post, this should be fixed at some point in the future.
  2. Expand the image to 1024x256 pixels.

Once this is done, you can add the following code to your project as a .atlas file. This will give you access to the 448 sprites as part of this sheet.

Get the spritesheet from Kenney's itch.io page. Developed against version 36 of the donation pack.

@JamesSkemp
JamesSkemp / Sitecore Media Library Image Pull
Last active September 2, 2015 19:14
Select image items from Sitecore Media Library via SQL.
var imageTemplate = Guid.Parse("{F1828A2C-7E5D-4BBD-98CA-320474871548}");
var jpgTemplate = Guid.Parse("{DAF085E8-602E-43A6-8299-038FF171349F}");
var fileSizeField = Guid.Parse("{6954B7C7-2487-423F-8600-436CB3B6DC0E}");
// For checking image properties, the below can be used.
var imageWidthField = Guid.Parse("{22EAC599-F13B-4607-A89D-C091763A467D}");
var imageHeightField = Guid.Parse("{DE2CA9E4-C117-4C8A-A139-1FF4B199D15A}");
var mediaItems = (
from item in Items
@JamesSkemp
JamesSkemp / SitecoreFQ-LockedItems
Created September 18, 2015 12:41
Sitecore - Fast query to find locked items
fast://*[@__lock='%domain%']
@JamesSkemp
JamesSkemp / Elmah Log Parsing.linq
Created October 4, 2015 00:42
Parse ELMAH logs via LINQPad.
<Query Kind="Program" />
void Main()
{
// If false, will disable all debugging messages.
var debug = true;
// If true, files will not really be deleted.
var testingDeletions = false;
// If true, dump the file name of Elmah logs that are deleted.
var debugDumpDeletedFileName = true;
@JamesSkemp
JamesSkemp / Extract Frames from GIF.cs
Last active October 7, 2015 01:38
Extract frames from GIF
var imagePath = @"C:\Users\James\Desktop\HL0hEkH.gif";
var exportDirectory = @"C:\Users\James\SkyDrive\Projects\graphic samples\export\";
var exportPathFormat = exportDirectory + "{0}.png";
Image img = Image.FromFile(imagePath);
var totalFrames = img.GetFrameCount(FrameDimension.Time);
string.Format("Total frames: {0}", totalFrames).Dump();
@JamesSkemp
JamesSkemp / Sitecore admin pages of note.md
Last active October 9, 2015 11:50
Sitecore admin pages of note
@JamesSkemp
JamesSkemp / iis_ssllabs_grade_a.ps1
Created October 18, 2015 00:24
Script from Alexander Hass to get an A on SSL Labs.
# J.Skemp: run Get-ExcutionPolicy and then Set-ExcutionPolicy Unrestricted before running the following.
# Make sure you set it back once done.
# Copyright 2014, Alexander Hass
# http://www.hass.de/content/setup-your-iis-ssl-perfect-forward-secrecy-and-tls-12
#
# Version 1.4
# - RC4 has been disabled.
# Version 1.3
# - MD5 has been disabled.
@JamesSkemp
JamesSkemp / New PowerShell Profile.ps1
Created November 12, 2015 04:11
Create a new PowerShell profile
# Test whether a profile exists. If it does, you can skip the following.
Test-path $profile
# Creates a profile.
New-item –type file –force $profile
# Bonus 1: Edit the profile in Notepad.
notepad $profile
# Bonus 2: What you probably want if you have any startup scripts defined in PowerShell.
@JamesSkemp
JamesSkemp / GitPrompt.ps1
Last active November 13, 2015 01:45
Customized GitHub prompt file.
# Inspired by Mark Embling
# http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration
$global:GitPromptSettings = New-Object PSObject -Property @{
DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor
BeforeText = ' ['
BeforeForegroundColor = [ConsoleColor]::Yellow
BeforeBackgroundColor = $Host.UI.RawUI.BackgroundColor
DelimText = ' |'
@JamesSkemp
JamesSkemp / NuGet - Install particular version of jQuery
Last active December 27, 2015 20:49
Install a particular version of a NuGet package. In this case jQuery.
Install-Package jQuery -Version 1.10.2