Skip to content

Instantly share code, notes, and snippets.

@WorthyD
WorthyD / Microsoft.PowerShell_profile.ps1
Last active March 11, 2022 20:39
Oh My Posh and Powershell
# https://ohmyposh.dev/
# https://www.nerdfonts.com/font-downloads -> Caskaydia Cove Nerd Font
#Enable Posh-Git
# Install-Module posh-git
$env:POSH_GIT_ENABLED = $true
Import-Module posh-git
#Enable Terminal Icons
get-appxpackage messaging | remove-appxpackage
get-appxpackage sway | remove-appxpackage
get-appxpackage commsphone | remove-appxpackage
get-appxpackage windowsphone remove-appxpackage
get-appxpackage phone | remove-appxpackage
@WorthyD
WorthyD / chocolately.txt
Last active December 17, 2020 22:36
New machine installs
#https://boxstarter.org/Learn/WebLauncher
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
choco install chocolateygui
choco install pc-decrapifier
choco install googlechrome
choco install 7zip.install
<div id="wrapper">
<h1>This is the primary heading and there should only be one of these per page</h1>
<p>A small paragraph to <em>emphasis</em> and show <strong>important</strong> bits.</p>
<ul>
<li>This is a list item</li>
<li>So is this - there could be more</li>
<li>Make sure to style list items to:
<ul>
<li>Not forgetting child list items</li>
<li>Not forgetting child list items</li>
<h1>This is the primary heading and there should only be one of these per page</h1>
<p>A small paragraph to <em>emphasis</em> and show <strong>important</strong> bits.</p>
<ul>
<li>This is a list item</li>
<li>So is this - there could be more</li>
<li>Make sure to style list items to:
<ul>
<li>Not forgetting child list items</li>
<li>Not forgetting child list items</li>
<li>Not forgetting child list items</li>
" Vim color file
" Maintainer: Marco Peereboom <slash@peereboom.us>
" Last Change: August 19, 2004
" Licence: Public Domain
" Try to emulate standard colors so that gvim == vim
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
@WorthyD
WorthyD / _vimrc
Last active August 20, 2019 14:29
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=$VIMRUNTIME/../vimfiles/bundle/Vundle.vim/
let path='$VIMRUNTIME/../vimfiles/bundle'
call vundle#begin(path)
"call vundle#begin()
" let Vundle manage Vundle, required
@WorthyD
WorthyD / GetCached.cs
Created July 8, 2014 15:17
Generic GetCached Query
/// <summary>
/// Generic caching call
/// </summary>
/// <typeparam name="TEntity">Class to map query to</typeparam>
/// <param name="query">Query to be executed</param>
/// <param name="CacheKey">Unique key used for reference on server</param>
/// <param name="CacheDurationSeconds">Duration for data to remain cached</param>
/// <returns> List of queried object</returns>
public IList<TEntity> GetCached<TEntity>(IQueryable<TEntity> query, string CacheKey, int CacheDurationSeconds) {
IList<TEntity> list = System.Web.HttpRuntime.Cache[CacheKey] as IList<TEntity>;
@WorthyD
WorthyD / KonamiCode.js
Created June 3, 2014 17:50
Konami Code Snippet
if ( window.addEventListener ) {
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
window.addEventListener("keydown", function(e){
kkeys.push( e.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 ){
//Logic
}
}, true);
}
var canTouch = 'ontouchstart' in window;
var startEvent = canTouch ? 'touchstart' : 'mousedown';
var moveEvent = canTouch ? 'touchmove' : 'mousemove';
var endEvent = canTouch ? 'touchend' : 'mouseup';