Skip to content

Instantly share code, notes, and snippets.

View alexweininger's full-sized avatar
💭
🐕‍🦺

Alex Weininger alexweininger

💭
🐕‍🦺
View GitHub Profile
@alexweininger
alexweininger / useful-vscode-settings.md
Last active February 3, 2023 23:39
Useful VS Code settings
  • git.defaultCloneDirectory
  • git.branchPrefix
  • git.branchProtection
  • git.branchRandomName.enable
import { GenericResource } from "@azure/arm-resources";
import {
AzExtParentTreeItem,
AzExtTreeItem,
IActionContext,
ISubscriptionContext,
TreeItemIconPath
} from "@microsoft/vscode-azext-utils";
import * as vscode from "vscode";
@alexweininger
alexweininger / foo.ts
Last active February 16, 2022 00:56 — forked from bwateratmsft/foo.ts
import { GenericResource } from '@azure/arm-resources';
import { AzExtTreeItem } from '@microsoft/vscode-azext-utils';
import * as vscode from 'vscode';
interface TreeNodeConfiguration {
readonly label: string;
readonly description?: string;
readonly icon?: vscode.ThemeIcon;
readonly contextValue?: string;
}
function sleep(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
@alexweininger
alexweininger / deleteRgs.bash
Created August 26, 2021 21:48
Delete RGs with tag
az group list --tag delete --query [].name -o tsv | xargs -otl az group delete --no-wait [-y ignores prompt] -n ${rg}
@alexweininger
alexweininger / CollectionClient.ts
Created August 15, 2021 04:21
Appwrite database collection client
import { Appwrite } from 'appwrite';
export type Document<T = any> = T & {
$id: string;
$collection: string;
$permissions: any;
};
export type DocumentsList<T = any> = {
sum: number;
@alexweininger
alexweininger / trimQuotes.ts
Created August 12, 2021 23:55
Trim quotes from a string
export function trimQuotes(str: string): string {
str = str.trim();
const arr = Array.from(str);
const quotationMark = '"';
const first = arr.findIndex(char => char !== quotationMark);
const last = arr.reverse().findIndex(char => char !== quotationMark);
return (first === -1 && last === -1) ? '' : str.substring(first, str.length - last);
}
@alexweininger
alexweininger / run.bat
Created July 11, 2020 00:44
Run Minecraft server with more ram
java -Xmx4096M -Xms4096M -jar server.jar
@alexweininger
alexweininger / launch.json
Created July 1, 2020 02:21
Launch Configuration for Debugging Deno in VS Code
{
"version": "0.2.0",
"configurations": [
{
"name": "Deno",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": ["run", "--inspect-brk", "-A", "${fileBasename}"],
@alexweininger
alexweininger / bck.20190326204151.navigator.settings.json
Last active April 14, 2019 20:43
Visual Studio Code Settings Sync Gist
{
"better-comments.tags": [
{
"tag": "!",
"color": "#FF2D00",
"strikethrough": false,
"backgroundColor": "transparent"
},
{
"tag": "?",