Skip to content

Instantly share code, notes, and snippets.

View JamesSkemp's full-sized avatar

James Skemp JamesSkemp

View GitHub Profile
@JamesSkemp
JamesSkemp / hb_all_books_dl.js
Last active June 29, 2024 14:50 — forked from zuazo/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
Forked from https://gist.github.com/zuazo/a91ecbb97b90ef3ef9ce8caf361199a2
Which was forked from https://gist.github.com/p0kR/95e05e689be4e59b1b8fb6e383b9e25a
After purchasing a Humble Book Bundle, go to your download page for that bundle.
Open a console window on the page and paste in the below JavaScript.
JamesSkemp fork changes:
- Fix ZIP file downloads.
- Add Chrome URLs to setting pages.
@JamesSkemp
JamesSkemp / information.md
Last active June 10, 2024 17:54
US Zip Code Geolocations from 2021 Gazetteer
@JamesSkemp
JamesSkemp / Humble Bundle individual page titles.md
Last active August 18, 2021 22:41
Humble Bundle individual page titles

Run in browser console, while viewing an individual bundles page post-purchase.

let items = [];
let titles = $('.gameinfo .title');
for (let i = 0; i < titles.length; i++) {
	items.push(titles[i].innerText);
}
console.log(items);
@JamesSkemp
JamesSkemp / README.md
Last active April 14, 2020 20:29
.NET auto versioning math

When using 1.0.*.* for the AssemblyVersion it will automatically populate the build and revision numbers.

Build number can be determined via the following LINQPad C# Statements.

var startingDate = new DateTime(2000, 1, 1);
DateTime.Now.Subtract(startingDate).Dump();

startingDate.AddDays(4695).Dump();
startingDate.AddDays(7409).Dump();
@JamesSkemp
JamesSkemp / red-sword-skills.md
Last active March 25, 2020 18:07
Red Sword (Android) Skills

Skills from Red Sword as of version 1.1.9. Some added from 1.2.1.

Order based upon Skill catalog.

Name Rarity Cooldown Damage Number Description Cost Inheritance Cost
F Laser Rod 2 6.2s 750 1 Fires a laser beam
F Laser Rod +1 3 6.4s 1400 1 Fires a laser beam
Magic Trigger 1 2.6s 38 1 Places a trap
Raining Arrows 1 8.7s 13 26 Magic arrows rain from above 600
@JamesSkemp
JamesSkemp / rpg-dice-roller.d.ts
Created August 17, 2019 03:54
TypeScript definitions for GreenImp/rpg-dice-roller
/** Declaration file generated by dts-gen */
/** For https://github.com/GreenImp/rpg-dice-roller */
/** This is a work in progress */
declare module "rpg-dice-roller" {
export class DiceRoll {
/**
*
* @param notation
*/
constructor(notation: string);
@JamesSkemp
JamesSkemp / find net version.linq
Created April 3, 2019 16:29
Find Installed .NET Version with LINQPad
<Query Kind="Program">
<Namespace>Microsoft.Win32</Namespace>
</Query>
// From https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
public static void Main()
{
Get45PlusFromRegistry();
}
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">
<sitecore search:require="solr">
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="sitecore_master_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
<param desc="core" patch:instead="param[@desc='core']">instance1_$(id)</param>
</index>
<index id="sitecore_core_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
@JamesSkemp
JamesSkemp / __.md
Last active June 7, 2018 20:04
Example getting first 10 requests from today's IIS logs and saving to dated txt file

See https://stackoverflow.com/a/10945887/11912 for more information on the first two lines (today is being set just to help understand the date formatting).

If run 6/7/2018, it would check the IIS log at C:\inetpub\logs\LogFiles\W3SVC1\u_ex180607.log and save the output to _test180607.txt.

@JamesSkemp
JamesSkemp / elmah - class.cs
Last active January 29, 2018 13:54
Parse ELMAH XML files with LINQPad (C# Program)
void Main()
{
// Update with the path to Elmah.Errors/where the ELMAH logs are being stored.
var directoryPath = @"\\path\to\Elmah.Errors\";
var directory = new DirectoryInfo(directoryPath);
var files = directory.GetFiles("*.xml").OrderByDescending(f => f.CreationTime);
files.Count().Dump();
var messages = new List<string>();