Skip to content

Instantly share code, notes, and snippets.

View balazsbotond's full-sized avatar

Botond Balázs balazsbotond

  • Budapest, Hungary
View GitHub Profile
import { myobject } from "../src/MyModule";
describe("myobject", () => {
it("should be defined", () => {
expect(myobject).toBeDefined();
});
});
@balazsbotond
balazsbotond / gbc.py
Last active June 16, 2024 11:01
Git Branch Cleanup - Asks if you want to delete local git branches that don't exist on any remote
#!/usr/bin/env python
import re
import os
import sys
from subprocess import check_output, check_call, call, STDOUT
BLUE = '\033[94m'
GRAY = '\033[90m'
ENDC = '\033[0m'
@balazsbotond
balazsbotond / ABOUT.md
Last active October 13, 2024 10:10
Simple Canvas Pan And Zoom

Simple Canvas Pan And Zoom

I needed a simple way to implement dragging and scroll wheel zooming on an HTML canvas, but I couldn't find a pure JS example. The most popular one uses an SVG node to convert coordinates, but I didn't like that so I created my own version.

Try it here: https://jsfiddle.net/balazsbotond/6n2uzjkq/30/

@balazsbotond
balazsbotond / notify.ps1
Last active April 28, 2024 04:01
PowerShell script for sending Windows 10 notifications
$ErrorActionPreference = "Stop"
$notificationTitle = "Build Succeeded"
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
$toastXml = [xml] $template.GetXml()
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null
$xml = New-Object Windows.Data.Xml.Dom.XmlDocument
$xml.LoadXml($toastXml.OuterXml)
$toast = [Windows.UI.Notifications.ToastNotification]::new($xml)
$toast.Tag = "Test1"