Skip to content

Instantly share code, notes, and snippets.

View whitneyit's full-sized avatar

James Whitney whitneyit

  • Sydney, Australia
View GitHub Profile
type ValueOf<T> = T[keyof T];
type DoesKeyExtendTypeMap<T extends keyof any, K extends keyof any> = {
[P in T]: K extends P ? true : false;
};
type OmitByValue<T, U> = Pick<T, OmitKeysByValue<T, U>>;
type OmitKeysByValue<T, U> = ValueOf<
{
[K in keyof T]: T[K] extends U ? never : K;
@whitneyit
whitneyit / consolas.reg
Created November 8, 2016 10:51
Set the default font for Windows to consolas
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Segoe UI (TrueType)"=""
"Segoe UI (TrueType)"=""
"Segoe UI Black (TrueType)"=""
"Segoe UI Black Italic (TrueType)"=""
"Segoe UI Bold (TrueType)"=""
"Segoe UI Bold Italic (TrueType)"=""
"Segoe UI Historic (TrueType)"=""
@whitneyit
whitneyit / base16-default.ocean.prefs.js
Last active March 2, 2016 02:47
Secure Shell prefs
term_.prefs_.set('background-color', '#2b303b');
term_.prefs_.set('foreground-color', '#c0c5ce');
term_.prefs_.set('cursor-color', '#c0c5ce');
term_.prefs_.set('color-palette-overrides', [
'#2b303b',
'#bf616a',
'#a3be8c',
'#ebcb8b',
'#8fa1b3',
@whitneyit
whitneyit / base16-default.dark.prefs.js
Last active March 3, 2016 05:04
Secure Shell prefs
term_.prefs_.set('background-color', '#181818');
term_.prefs_.set('foreground-color', '#d8d8d8');
term_.prefs_.set('cursor-color', '#f8f8f8');
term_.prefs_.set('color-palette-overrides', [
'#181818',
'#ab4642',
'#a1b56c',
'#f7ca88',
'#7cafc2',
@whitneyit
whitneyit / modal.html
Last active March 2, 2016 02:52
Hide and show a modal without affecting the scrollbar
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Modal example</title>
<style>
/* INIT */
html {
background-color: red;
@whitneyit
whitneyit / log.md
Created July 31, 2015 22:29
Git log alias

Alias with git autocomplete

alias          gl="git log --date=iso --pretty=format:'%C(yellow)%h %C(green)[%ad | %>(14)%ar] %C(cyan)%ae %C(reset)%s%C(white)%d'"
__git_complete gl _git_log

log.png

@whitneyit
whitneyit / Prerender.md
Last active March 2, 2016 02:50
preprender.io checklist

Ensure that the following occurs

  • Serve the crawlers prerendered HTML, not JavaScript.
  • Don’t send soft 404’s.
  • If you’re sticking with #’s for your urls, make sure to set the hashPrefix('!') so that the URL’s are rewritten as #!'s.
  • If you have a lot of pages and content, be sure to include a sitemap.xml and robots.txt.
  • Google crawls only a certain number of pages per day, which is dependent on your PageRank. Including a sitemap.xml will allow you to prioritize which pages get indexed.
  • When testing to see how your AngularJS pages render in Google Webmaster Tools, be sure to add the #! or ?_escaped_fragment_= in the right place as the manual tools do not behave exactly as the actual crawlers do.

Things to look out for

@whitneyit
whitneyit / external.css
Created May 8, 2015 01:06
External link indicator
a[target="_blank"]:after {
content: '';
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAA/UlEQ…I6iUfbcwhYlNkGPGNBgTg6MEoCX0lWBBvwXF/u/c/87g96DLwN1VorFQAAAABJRU5ErkJggg==);
display: inline-block;
height: 10px;
margin: 0 3px 0 5px;
width: 10px;
}
@whitneyit
whitneyit / _warhammer.md
Last active June 3, 2019 15:23
A collection of Painting Guides for various Warhammer 40k models

Warhammer 40k Painting Guides.

Before I can complete the following guides, I require the following paints:

And the following paints for ornaments and details.