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 October 11, 2022 23:46 — 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.
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "os",
"style": "plain",
@connorjclark
connorjclark / memory-test.ts
Created May 27, 2020 18:48
memory leak test
import { ChildProcess, spawn } from 'child_process';
import * as puppeteer from 'puppeteer';
const DEBUG = Boolean(process.env.DEBUG);
const CI = Boolean(process.env.CI);
const QUERY = Boolean(process.env.QUERY);
jest.setTimeout((QUERY ? 200 : 100) * 1000);
interface MemorySample {
youtube.com##.ytp-ce-covering-overlay
youtube.com##.ytp-ce-element-shadow
youtube.com##.ytp-ce-covering-image
youtube.com##.ytp-ce-expanding-image
youtube.com##.ytp-ce-element.ytp-ce-video.ytp-ce-element-show
@zuazo
zuazo / hb_all_books_dl.js
Last active September 10, 2022 14:36 — forked from p0kR/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
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 for the page and paste in the below javascript
this fork downloads all formats and does so without using jquery (since that didnt work for me)
note that if you are in chrome, chrome will not download the pdfs for you by default, to fix this
Settings (chrome://settings) --> Advanced --> Privacy and security --> Content settings --> PDF documents --> Download PDF files instead of automatically opening them in Chrome --> Turn ON
@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@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

Table altering, in T-SQL

Change table schema

Change the schema on an existing table.

ALTER SCHEMA projectManagement
TRANSFER dbo.RequestPriority

Change column

@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();