Skip to content

Instantly share code, notes, and snippets.

View prettycode's full-sized avatar

Chris prettycode

  • Seattle, WA
View GitHub Profile
@prettycode
prettycode / Win10-16257-Console-Colors.reg
Created November 19, 2017 17:01 — forked from richardszalay/Win10-16257-Console-Colors.reg
Applies the default console colors added in Windows 10 16256 (https://blogs.msdn.microsoft.com/commandline/2017/08/02/updating-the-windows-console-colors/) to older versions of Windows
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console]
"ColorTable00"=dword:000c0c0c
"ColorTable01"=dword:00da3700
"ColorTable02"=dword:000ea113
"ColorTable03"=dword:00dd963a
"ColorTable04"=dword:001f0fc5
"ColorTable05"=dword:00981788
"ColorTable06"=dword:00009cc1
@prettycode
prettycode / fork-your-own-gist.js
Last active December 16, 2015 08:58
A function that forks a Gist. You can use this to fork your own Gists.
function forkGist(user, gist) {
var path = (arguments.length ? ('/' + user + '/' + gist) : location.pathname);
var form = document.createElement('form');
form.method = 'post';
form.action = 'https://gist.github.com' + path + '/fork',
form.submit();
}
// Paste into browser console when viewing a Gist (including your own) to fork it
forkGist();
@prettycode
prettycode / submitForm.js
Last active December 16, 2015 07:49
Use this function to submit an HTML form without actually having a form on the page. Instead of an existing form, pass the function a *flat* JavaScript object with the form values to submit. This is a synchronous operation; the browser loads the response as its new window location. Requests with "Content-Type: application/x-www-form-urlencoded".
var submitForm = function(config) {
if (!config) {
throw new Error();
}
else {
config.method = config.method || 'post';
config.data = config.data || {};
config.url = config.url || (function() {
throw new Error('Missing required `url` argument');