Skip to content

Instantly share code, notes, and snippets.

View ChaseFlorell's full-sized avatar
🇨🇦

Chase Florell ChaseFlorell

🇨🇦
View GitHub Profile
@ChaseFlorell
ChaseFlorell / boxstarter.ps1
Last active November 29, 2015 19:55
2015-boxstarter
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOsFiles -showFileExtensions
Enable-RemoteDesktop
choco install agentransack -y
choco install xamarin -y
choco install resharper -y
choco install visualstudio2013professional -y
choco install git -y
choco install poshgit -y
choco install greenshot -y
@ChaseFlorell
ChaseFlorell / ObservableObject.cs
Created September 25, 2015 15:14
Observable Object for Xamarin Forms
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using Xamarin.Forms; // PropertyChanging event handler, and Command object
namespace Some.Namespace
{
public abstract class ObservableObject : INotifyPropertyChanged
@ChaseFlorell
ChaseFlorell / 1-FunctionTranslator.ps1
Last active August 29, 2015 14:27
First stab at translating functions.
param(
[Parameter(Mandatory=$true, Position=0)]$key
)
Write-Verbose "Attempting to establish new function '$key'"
$keyParts = ($key -split '-')
if($keyParts.length -gt 0){
$validVerb = Get-Verb $keyParts[0]
if(!$validVerb){
Write-Warning "'$($keyParts[0])' is an unapproved verb which might make it less discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of approved verbs."
}
@ChaseFlorell
ChaseFlorell / pipline.test.ps1
Created June 12, 2015 17:45
Powershell Write-Output vs return
clear
function Invoke-First {
Write-Output 'if not piped, will display before Write-Host, if piped, will display after Write-Host'
Write-Host 'Writes every single time invoke-first is called, but is not piped out.'
return 'will not display unless piped or used as a return variable'
}
function Invoke-Second {
param(
[Parameter(ValueFromPipeline=$True)] [string] $val
@ChaseFlorell
ChaseFlorell / benchmark.ps1
Last active August 29, 2015 14:21
Powershell inner collection iteration performance benchmark
$complexObject = @{
test = "test"
guid = [guid]::NewGuid()
int = [int]::MaxValue
str = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
arr = @(1..100)
}
$complexCollection = @()
$sw = [System.Diagnostics.Stopwatch]::StartNew()
@ChaseFlorell
ChaseFlorell / Execute.ps1
Last active July 28, 2021 11:03
Passing switches to child functions within PowerShell
# this is the final (child) function being called
function Invoke-Foo {
[cmdletbinding()]
param([switch] $Custom)
Write-Host 'Hello world'
Write-Verbose 'I''m a verbose message'
Write-Debug 'I''m a debug message' #this will pause execution
if($Custom.IsPresent){
Write-Host 'I''m a custom message'
@ChaseFlorell
ChaseFlorell / markdown.css
Last active December 26, 2023 19:29 — forked from imjasonh/markdown.css
.md *{
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
.md h1::before { content: "# "; }
@ChaseFlorell
ChaseFlorell / keybindings.json
Created May 7, 2015 15:29
Visual Studio Code Customizations
[
{ "key": "ctrl+f4", "command": "workbench.action.closeActiveEditor" }
]
source ~/.git-completion.bash
source ~/.git-prompt.sh
alias edit='open -a visual\ studio\ code'
alias cd..='cd ..'
alias co='git checkout'
alias pull='git fetch;git pull'
alias chr='open -a Google\ Chrome'
alias projects='cd ~/Projects'
@ChaseFlorell
ChaseFlorell / invoke-outHtml.ps1
Last active October 9, 2015 01:31
A PowerShell document generator Influenced by Vegard Hamar's [Out-Html](http://poshcode.org/587)
Import-Module MyAwesomeModule
.\out-html.ps1 -moduleName 'MyAwesomeModule' -outputDir "path\to\output"