Skip to content

Instantly share code, notes, and snippets.

View deanbot's full-sized avatar

Dean Verleger deanbot

View GitHub Profile
@deanbot
deanbot / aoc2020_4.dart
Created December 4, 2020 15:06
Advent Of Code 2020 Day 4 in dart
void main() {
final List<Object> solutions = [
SolutionA(),
SolutionB()
];
solutions.forEach((s) => print(s.toString()));
}
// Full inputs at https://adventofcode.com/2020/day/4/input
var inputAdvent4 = """pid:087499704 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980
@deanbot
deanbot / aoc2020_3.dart
Last active December 3, 2020 22:46
Advent Of Code 2020 Day 3 in dart
void main() {
final List<Object> solutions = [
SolutionA(),
SolutionB()
];
solutions.forEach((s) => print(s.toString()));
}
// Full inputs at https://adventofcode.com/2020/day/3/input
var inputAdvent3 = """..##.......
@deanbot
deanbot / aoc2020_2.dart
Last active December 2, 2020 19:28
Advent Of Code 2020 Day 2 in dart
void main() {
int i = 0;
final List<Object> solutions = [
SolutionA(),
SolutionB()
];
solutions.forEach((s) => print(s.toString()));
}
// Full inputs at https://adventofcode.com/2020/day/2/input
@deanbot
deanbot / aoc2020_1.dart
Last active December 2, 2020 16:27
Advent Of Code 2020 Day 1 in dart
void main() {
int i = 0;
final List<AdventSolution> solutions = [
AdventSolution1(inputAdvent1),
AdventSolution2(inputAdvent1)
];
solutions.forEach((s) => print("Advent ${++i} solution: ${s.solution}"));
}
// Full inputs at https://adventofcode.com/2020/day/1/input
@deanbot
deanbot / Read-InputLine.ps1
Last active July 3, 2021 09:27
(PowerShell) Read-InputLine
# Like Read-Line but can be exited from via a configured key press
#
# Returns the entered string or $false if CancelKeyCode (default is Esc) pressed
# Input truncated in display to fit one line
function Read-InputLine {
param (
[Parameter(Mandatory = $false, Position = 0)]
[string]$Prompt = "",
[Parameter(Mandatory = $false, Position = 1)]
@deanbot
deanbot / index.php
Created June 17, 2020 02:29
KirbyText mark-tag (include in site/plugins/mark-tag)
<?php
Kirby::plugin('mark/tag', [
'tags' => [
'mark' => [
'html' => function($tag) {
return '<mark>' . $tag->value . '</mark>';
}
]
]
@deanbot
deanbot / keepawake.ps1
Last active July 19, 2022 16:03 — forked from jamesfreeman959/keepawake.ps1
PowerShell script to keep a Windows PC awake
# PowerShell script to keep a Windows PC awake
Write-Host "Keeping PC awake... (send Ctrl+C to quit)"
while (1) {
$wsh = New-Object -ComObject WScript.Shell
$wsh.SendKeys('+{F15}')
Start-Sleep -seconds 59
}
@deanbot
deanbot / MyMergingFunction.cs
Last active August 19, 2019 19:55
cs azure function merging pdfs
using System.Text;
namespace MyFunction
{
public static class MyFunction
{
public static async Task<IActionResult> ItsMyFunction ()
{
// this is needed so that an encoding error is avoided when merging the 2 ca pdfs with PDFSharp
// https://gunnarpeipman.com/net/no-data-is-available-for-encoding/
<style type="text/css" media="screen,print">
/* Page Breaks */
/***Always insert a page break before the element***/
.pb_before {
page-break-before: always !important;
}
/***Always insert a page break after the element***/
.pb_after {
<!doctype html>
<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta charset='utf-8' />
<script>
function subst() {
// get query vars
var vars = {};