Skip to content

Instantly share code, notes, and snippets.

/// <summary>
/// Get Catholic easter for requested year
/// </summary>
/// <param name="year">Year of easter</param>
/// <returns>DateTime of Catholic Easter</returns>
public static DateTime GetCatholicEaster(int year)
{
var month = 3;
var a = year % 19 + 1;
@tdoumas
tdoumas / STRING_AGG.cs
Last active April 17, 2022 19:29 — forked from lbehm/STRING_AGG.cs
SQL Server Aggregate to concatenate strings - shim for STRING_AGG
using System;
using System.Data.SqlTypes;
using System.IO;
using System.Text;
using Microsoft.SqlServer.Server;
[Serializable]
[SqlUserDefinedAggregate(
Format.UserDefined,
IsInvariantToNulls = true,
@tdoumas
tdoumas / InstallSoftware.ps1
Last active March 19, 2023 22:39 — forked from dougwaldron/InstallSoftware.ps1
Install software with winget / automate installation with PowerShell
# 1. Make sure the Microsoft App Installer is installed:
# https://www.microsoft.com/en-us/p/app-installer/9nblggh4nns1
# 2. Edit the list of apps to install.
# 3. Run this script as administrator.
Write-Output "Installing Apps"
$apps = @(
@{name = "7zip.7zip" },
@{name = "Adobe.Acrobat.Reader.64-bit" },
@{name = "Axosoft.GitKraken" },
@tdoumas
tdoumas / git pretty logs
Created July 13, 2017 12:27 — forked from dglowinski/git pretty logs
git pretty logs
[alias]
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
app.directive('datepickerLocaldate', ['$parse', function ($parse) {
var directive = {
restrict: 'A',
require: ['ngModel'],
link: link
};
return directive;
function link(scope, element, attr, ctrls) {
var ngModelController = ctrls[0];
// In app.js or main.js or whatever:
// var myApp = angular.module('askchisne', ['ngSanitize', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']);
// This filter makes the assumption that the input will be in decimal form (i.e. 17% is 0.17).
myApp.filter('percentage', ['$filter', function ($filter) {
return function (input, decimals) {
return $filter('number')(input * 100, decimals) + '%';
};
}]);

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname