This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tries to match everything until the owner field as the workspace name (thanks redgate sql source control) | |
tf workspaces /owner:domain\username| | |
Select-Object -Skip 2 | | |
ForEach-Object { | |
if ($_ -match "^(.*?)Username") { | |
$workspace = $Matches[1].Trim() | |
Write-Host "Will delete workspace: $workspace" | |
tf workspace /delete "$workspace;domain\username" /noprompt | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete all bin and obj folders recursively | |
function del-obj-bin { | |
Param ([string]$Path = ".\") | |
$title = 'Delete all nested obj and bin folders' | |
$question = 'Are you sure you want to proceed?' | |
$choices = '&Yes', '&No' | |
$decision = $Host.UI.PromptForChoice($title, $question, $choices, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { computed, Comment, Fragment, Text } from 'vue' | |
/** | |
* Determines whether a slot is empty for Vue 3: https://github.com/vuejs/vue-next/issues/3056 | |
* @param {Function} slot - The slot $slot.name | |
* @returns {Boolean} | |
*/ | |
// Adapted from https://github.com/vuejs/vue-next/blob/ca17162e377e0a0bf3fae9d92d0fdcb32084a9fe/packages/runtime-core/src/helpers/renderSlot.ts#L77 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-ChatGPT { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true, Position = 0)] | |
[string]$Prompt, | |
[Parameter(Mandatory = $false)] | |
[int]$MaxTokens = 50 | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useSlots } from 'vue'; | |
export default function useHasSlot() { | |
const slots = useSlots(); | |
return function hasSlot(name) { | |
return slots[name] && !isEmptySlot(slots[name]()); | |
}; | |
} | |
function isEmptySlot(items) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pico-8 cartridge // http://www.pico-8.com | |
version 39 | |
__lua__ | |
function _init() | |
mouse.init() | |
points = {} | |
sticks = {} | |
bounce=0.9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ pancelor printh debugging | |
from https://www.lexaloffle.com/bbs/?tid=42367 | |
pq() is your swiss army knife | |
for debugging. use it to check | |
what your computer is actually | |
doing! | |
basic usage: | |
pq(x,y) - this is similar to | |
calling printh(x..y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--from https://www.lexaloffle.com/bbs/?tid=3549 | |
mouse = { | |
init = function() | |
poke(0x5f2d, 1) | |
end, | |
-- return int:x, int:y, onscreen:bool | |
pos = function() | |
local x,y = stat(32)-1,stat(33)-1 | |
return stat(32)-1,stat(33)-1 | |
end, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project InitialTargets="" DefaultTargets="All" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | |
<PropertyGroup> | |
<AssemblyFile>$(MSBuildThisFileDirectory)\..\packages\MSBuild.Extension.Pack\tools\net40\MSBuild.ExtensionPack.TaskFactory.PowerShell.dll</AssemblyFile> | |
</PropertyGroup> | |
<UsingTask TaskFactory="PowershellTaskFactory" TaskName="CreateDatabaseTask" AssemblyFile="$(AssemblyFile)"> | |
<ParameterGroup> | |
<ScriptsDirectory Required="true" ParameterType="System.String" /> | |
<Server Required="true" ParameterType="System.String" /> |
NewerOlder