Skip to content

Instantly share code, notes, and snippets.

View JamesSkemp's full-sized avatar

James Skemp JamesSkemp

View GitHub Profile
@JamesSkemp
JamesSkemp / OrthographicCameraController.java
Last active November 1, 2022 17:32
An orthographic camera controller that handles inputs and gestures, for libGDX.
package com.jamesrskemp.libgdx.utils;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.input.GestureDetector;
import com.badlogic.gdx.math.Vector2;
/**
@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 LINQPad search queries.md
Last active March 11, 2016 15:27
Sitecore LINQPad search queries

Sitecore LINQPad search queries

The following queries can be run in LINQPad to run searches against the Sitecore database.

Search for a term in versioned and shared fields.

This script searches against all versioned and shared fields for a search term.

It will return any results from the current version of the item.

@JamesSkemp
JamesSkemp / NCSU Web Evaluation Tools Bookmarklet console-ified.js
Created August 27, 2015 15:31
NCSU Web Evaluation Tools Bookmarklet console-ified
// A browser console-ready conversion of NCSU's bookmarlet. See http://accessibility.oit.ncsu.edu/tools/web-evaluation-tools/
var yourURL=(window.location.protocol=='http:'?'http://webapps.ncsu.edu/web-evaluation-tools/web-evaluation-tools.php':'https://webapps.ncsu.edu/web-evaluation-tools/web-evaluation-tools.php');
function getScript(url,success){
var script=document.createElement('script');script.src=url;
var head=document.getElementsByTagName('head')[0],done=false;
script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){
done=true;success();script.onload=script.onreadystatechange=null;head.removeChild(script);
}
};
head.appendChild(script);
@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 / Visual Studio solution file headers
Last active February 11, 2023 21:42
Visual Studio solution file headers - 2010, 2012, 2013, 2015
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
@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.