Skip to content

Instantly share code, notes, and snippets.

// run this in the dev console on RealClearPolitics polling chart pages
// https://www.realclearpolitics.com/epolls/2020/president/us/2020_democratic_presidential_nomination-6730.html
function hide(c, idx) {
c.forEach(function (ci) {
Array.from(document.getElementsByClassName(ci)).forEach((el, i) => {
el.style.visibility = 'visible';
if (!idx.includes(i)) el.style.visibility = 'hidden';
});
});
@kenwarner
kenwarner / GitPrompt.ps1
Created February 7, 2016 01:57
GitPrompt.ps1 with more color options
# Inspired by Mark Embling
# http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration
$global:GitPromptSettings = New-Object PSObject -Property @{
DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor
DefaultBackgroundColor = $Host.UI.RawUI.BackgroundColor
BeforeText = ' ['
BeforeForegroundColor = [ConsoleColor]::Yellow
BeforeBackgroundColor = $DefaultBackgroundColor
@kenwarner
kenwarner / profile.example.ps1
Created February 7, 2016 01:56
profile.example.ps1 with more color options
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
# Load posh-git module from current directory
Import-Module .\posh-git
# If module is installed in a default location ($env:PSModulePath),
# use this instead (see about_Modules for more information):
# Import-Module posh-git
@kenwarner
kenwarner / profile.example.ps1
Created February 6, 2016 22:20
GitHub PoshGit prompt colors
# look for profile.example.ps1 in your %USERPROFILE%\AppData\Local\GitHub\PoshGit_somerandomlettersandnumbers\ folder
# add the following after the Enable-GitColors line
$global:GitPromptSettings.IndexForegroundColor = [ConsoleColor]::Green
$global:GitPromptSettings.WorkingForegroundColor = [ConsoleColor]::Red
$global:GitPromptSettings.UntrackedForegroundColor = [ConsoleColor]::Magenta
$global:GitPromptSettings.BranchAheadForegroundColor = [ConsoleColor]::Green
$global:GitPromptSettings.BranchBehindForegroundColor = [ConsoleColor]::Magenta
@kenwarner
kenwarner / .gitconfig
Created February 6, 2016 22:14
git status colors
[color "status"]
header = black normal bold # the header text of the status message
added = green normal bold # files which are added but not committed
updated = green normal bold # files which are added but not committed
hanged = yellow normal bold # files which are changed but not added in the index
untracked = cyan normal bold # files which are not tracked by Git
branch = magenta normal bold # the current branch
nobranch = normal normal bold # the color the no branch warning is shown in, defaulting to red
unmerged = red normal bold # files which have unmerged changes
# available colors are normal, black, red, green, yellow, blue, magenta, cyan and white
cinst 1password
cinst 7zip
cinst 7zip.install
cinst AdobeAIR
cinst adobereader
cinst Atom
cinst markdownpad2
cinst autohotkey.portable
cinst beyondcompare
cinst curl
@kenwarner
kenwarner / Program.cs
Created July 11, 2014 02:22
Is null a valid value for a dependency from a factory method?
namespace ConsoleApplication1
{
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Castle.Windsor.Installer;
public interface IFoo
{
}