Skip to content

Instantly share code, notes, and snippets.

View TylerLeonhardt's full-sized avatar
🌴
Vacation!

Tyler James Leonhardt TylerLeonhardt

🌴
Vacation!
View GitHub Profile
@TylerLeonhardt
TylerLeonhardt / twitter.ps1
Last active December 27, 2022 14:15
Search Twitter
<#
.SYNOPSIS
Creates access token for Twitter API calls. To get keys go to: https://apps.twitter.com/
.DESCRIPTION
Creates access token for Twitter API calls. To get keys go to: https://apps.twitter.com/
.PARAMETER ConsumerKey
The ConsumerKey. You get this from https://apps.twitter.com/
.PARAMETER ConsumerSecret
The ConsumerSecret. You get this from https://apps.twitter.com/
.EXAMPLE
@TylerLeonhardt
TylerLeonhardt / Init.vim
Created May 24, 2018 16:32
NeoVim PowerShell setup
call plug#begin('~/.local/share/nvim/plugged')
" Handles the fzf popups
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" The LSP client
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
<#PSScriptInfo
.VERSION 0.1.0
.GUID 05c41fde-bd40-4dd3-a72e-12ec14a50676
.AUTHOR Tyler Leonhardt
.COMPANYNAME Tyler Leonhardt
@TylerLeonhardt
TylerLeonhardt / registercommand.ps1
Last active October 30, 2018 01:10
An Editor Command for the PowerShell extension for VSCode that leverages https://gist.github.com/tylerl0706/3d1618572f7a424dab812e9cce5e3a15
using namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
using namespace Microsoft.PowerShell.EditorServices.Protocol.Messages
function Read-InputPrompt {
param([string]$Prompt)
end {
$result = $psEditor.
Components.
Get([IMessageSender]).SendRequest(
[ShowInputPromptRequest]::Type,
@TylerLeonhardt
TylerLeonhardt / Invoke-PSNotification.ps1
Last active November 9, 2018 17:11
Show notifications on Linux using PowerShell! Thanks to notify-send(1)
function Send-PSNotification {
[cmdletbinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory,ValueFromPipeline,Position=0)]
[object[]]
$Body,
[String]
$Summary = 'PowerShell Notification',
@TylerLeonhardt
TylerLeonhardt / sillyparameterchecking.ps1
Created January 17, 2019 19:45
silly parameter checking
function Send-PSNotification {
[cmdletbinding()]
param(
[Parameter(Mandatory,ValueFromPipeline,Position=0)]
[object]
$Body,
[String]
$Summary = 'PowerShell Notification',
openapi: 3.0.0
info:
title: Octocat
description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
version: 0.1.9
servers:
- url: http://api.github.com
description: Optional server description, e.g. Main (production) server
paths:
/octocat:
@TylerLeonhardt
TylerLeonhardt / Dockerfile
Last active December 11, 2020 22:53
code-server, powershell and the PowerShell extension for vscode
FROM codercom/code-server
#
# Add PowerShell
#
ARG PS_VERSION=6.2.0
ARG PS_PACKAGE=powershell_${PS_VERSION}-1.ubuntu.18.04_amd64.deb
ARG PS_PACKAGE_URL=https://github.com/PowerShell/PowerShell/releases/download/v${PS_VERSION}/${PS_PACKAGE}
@TylerLeonhardt
TylerLeonhardt / build.ps1
Created April 25, 2019 18:23
build.ps1 for Cake
##########################################################################
# This is the Cake bootstrapper script for PowerShell.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
##########################################################################
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
@TylerLeonhardt
TylerLeonhardt / DefaultBrowser.ps1
Last active June 2, 2021 08:43
Get and Set the default browser on macOS. Also is an example at how to leverage other scripting languages within PowerShell
# NOTE: This still pops a dialog... I can't seem to figure out how to -Force it to not show.
function Set-DefaultBrowser {
[CmdletBinding(SupportsShouldProcess = $true)]
param(
[Parameter(Mandatory = $true)]
$BrowserId
)
$pythonScript = @"
from LaunchServices import LSSetDefaultHandlerForURLScheme