Skip to content

Instantly share code, notes, and snippets.

View hur1can3's full-sized avatar

Matthew Levandowski hur1can3

  • Grand Rapids, MI
View GitHub Profile
<%@ Control Language="C#" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<!-- For Sitefinity version 11.0 and above, use the code snippet between start and end below -->
<!-- start -->​
<sf:ResourceLinks id="ResourceLinks2" runat="server" UseBackendTheme="True" UseEmbeddedThemes="true">
<sf:ResourceFile Name="Styles/jQuery/jquery-ui-timepicker-addon.css" />
<sf:ResourceFile Name="Styles/jQuery/jquery.ui.datepicker.css" />
<sf:ResourceFile Name="Styles/jQuery/jquery.ui.slider.css" />
<sf:ResourceFile Name="Styles/jQuery/jquery.ui.theme.sitefinity.css" />
@m-radzikowski
m-radzikowski / script-template.sh
Last active February 27, 2026 03:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@hur1can3
hur1can3 / GenerateEfCoreMigrationSeedData.cs
Created December 10, 2020 19:10
Generation Ef Core Migration Builder Has Data Seed Data initializer from exsiting data in dbcontext
// If data already existins in dbcontext tables it Returns Migration Builder Seed data in form of string containing initialers to modulBuilder.Entity
#r "nuget:Microsoft.EntityFrameworkCore.SqlServer/5.0.1"
#r "nuget:Microsoft.EntityFrameworkCore/5.0.1"
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.SqlServer;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@hur1can3
hur1can3 / generatepocos.sql
Created April 6, 2020 18:45
TSQL create pocos for tables with annotations for length and nullable types
DECLARE @tableName VARCHAR(200);
DECLARE @columnName VARCHAR(200);
DECLARE @nullable VARCHAR(50);
DECLARE @datatype VARCHAR(50);
DECLARE @nullableSign VARCHAR(10);
DECLARE @columnType VARCHAR(200);
DECLARE @maxlen INT;
DECLARE @sType VARCHAR(50);
DECLARE @sProperty VARCHAR(200);
@hawjeh
hawjeh / WebinarController.cs
Last active June 29, 2021 15:54
Sitefinity - Sample best practices when implementing custom MVC Widgets
using SitefinityWebApp.Mvc.Models;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web.Mvc;
using Telerik.Sitefinity.ContentLocations;
using Telerik.Sitefinity.Data;
using Telerik.Sitefinity.DynamicModules;
using Telerik.Sitefinity.DynamicModules.Builder.Model;
using Telerik.Sitefinity.DynamicModules.Model;
@benmccallum
benmccallum / SqlKataExample.cs
Last active February 14, 2022 06:59
Cursor-based paging for connections with MS SQL CTEs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using AutoGuru.Client.Shared;
using AutoGuru.Client.Shared.Dtos;
using AutoGuru.Client.Shared.Models;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
@bearfrieze
bearfrieze / comprehensions.md
Last active March 13, 2026 03:04
Comprehensions in Python the Jedi way

Comprehensions in Python the Jedi way

by Bjørn Friese

Beautiful is better than ugly. Explicit is better than implicit.

-- The Zen of Python

I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.

using System;
using System.Runtime.InteropServices;
// ReSharper disable SuspiciousTypeConversion.Global
// ReSharper disable InconsistentNaming
namespace VideoPlayerController
{
/// <summary>
/// Controls audio using the Windows CoreAudio API
/// from: http://stackoverflow.com/questions/14306048/controling-volume-mixer
@simonmichael
simonmichael / envelope-budgeting.journal
Last active March 20, 2025 08:52
envelope budgeting example
; An example of YNAB-ish envelope budgetting with hledger/ledger
; cf https://github.com/simonmichael/hledger/issues/315
; Using accounts like the following:
;
; assets
; business
; bank
; wf
; bchecking
<Query Kind="Program">
<NuGetReference>Octokit</NuGetReference>
<NuGetReference>Octokit.Reactive</NuGetReference>
<NuGetReference>Rx-Main</NuGetReference>
<Namespace>Octokit</Namespace>
<Namespace>System.Linq</Namespace>
<Namespace>System.Reactive.Linq</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
</Query>