Skip to content

Instantly share code, notes, and snippets.

View mmunchandersen's full-sized avatar

Morten Munch-Andersen mmunchandersen

View GitHub Profile
@Badgerati
Badgerati / Test-CronExpression.ps1
Last active April 13, 2023 21:53
PowerShell cron expression parser, to check if a date/time matches a cron expression
<#
.DESCRIPTION
PowerShell cron expression parser, to check if a date/time matches a cron expression
Format:
<min> <hour> <day-of-month> <month> <day-of-week>
.PARAMETER Expression
A cron expression to validate
.PARAMETER DateTime
@voskobovich
voskobovich / gist:537b2000108e4781f70b
Last active June 30, 2024 01:33
List of most currency ISO code and symbol format in SQL.
DROP TABLE currency;
-- Create table variable
CREATE TABLE currency (
name VARCHAR(20),
code VARCHAR(3),
symbol VARCHAR(5)
);
ALTER TABLE currency CONVERT TO CHARACTER SET utf8;
@dbroeglin
dbroeglin / Compare-Hashtable.Tests.ps1
Last active June 28, 2022 09:28
A simple Compare-Hashtable function for powershell
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
. "$here\$sut"
Describe "Compare-Hashtable" {
Context "When both are empty" {
$Left, $Right = @{}, @{}
It "should return nothing" {
Compare-Hashtable $Left $Right | Should BeNullOrEmpty
<#
.SYNOPSIS
Resize an image
.DESCRIPTION
Resize an image based on a new given height or width or a single dimension and a maintain ratio flag.
The execution of this CmdLet creates a new file named "OriginalName_resized" and maintains the original
file extension
.PARAMETER Width
The new width of the image. Can be given alone with the MaintainRatio flag
.PARAMETER Height
@rally25rs
rally25rs / kendo.binders.class.js
Created August 4, 2014 12:03
Class MVVM binder for Kendo UI
kendo.data.binders.class = kendo.data.Binder.extend({
init: function (target, bindings, options) {
kendo.data.Binder.fn.init.call(this, target, bindings, options);
// get list of class names from our complex binding path object
this._lookups = [];
for (var key in this.bindings.class.path) {
this._lookups.push({
key: key,
path: this.bindings.class.path[key]