Skip to content

Instantly share code, notes, and snippets.

View lucamilan's full-sized avatar
🏠
Working from home

Luca Milan lucamilan

🏠
Working from home
View GitHub Profile
@lucamilan
lucamilan / main.tf
Last active September 16, 2022 07:54
Simple Terraform scripts
resource "local_file" "myfile" {
filename = "Readme.md"
content = "# Hello from Terraform sample!"
}
@lucamilan
lucamilan / u2u_student_laptop_boxstarter.txt
Created September 1, 2022 20:59 — forked from SqlWaldorf/u2u_student_laptop_boxstarter.txt
BoxStarter list of packages to install on a new windows machine
choco feature enable -n allowGlobalConfirmation
cinst Chocolatey
cinst azcopy
cinst azure-cli
cinst azurepowershell
cinst sql-server-express
cinst sql-server-management-studio
cinst powerbi
cinst sqlsentryplanexplorer
cinst curl
@lucamilan
lucamilan / build-deploy.yaml
Created November 24, 2021 15:30
Build and Deploy modern applications with Type
name: Build and Deploy
on:
push:
branches:
- master
jobs:
deploy:
name: Deploy
@lucamilan
lucamilan / ml2021-boxstarter.ps1
Last active November 9, 2021 16:49 — forked from ZinkNotTheMetal/mam-boxstarter.ps1
MyLaptop2021-BoxStarter
# Invoke using following syntax into IE:
# http://boxstarter.org/package/url?https://gist.githubusercontent.com/lucamilan/7b3f1c53ea66f943c6899777fd7baf55/raw/b7167b7bc0a573944b3b4324538c9762babe0b1a/ml2021-boxstarter.ps1
try {
# Boxstarter options
$Boxstarter.RebootOk = $true
$Boxstarter.NoPassword = $false # Is this a machine with no logon password?
$Boxstarter.AutoLogin = $true
# --- TEMPORARILY DISABLE --- #
@lucamilan
lucamilan / index.pug
Created April 19, 2021 20:15
Simple Calendar
div#main.container
div.jumbotron
h1.text-center
a#left(href="#")
i.fa.fa-chevron-left
span  
span#month
span  
span#year
@lucamilan
lucamilan / infinite_loop.cs
Created April 18, 2021 08:46
Infinite Loop with Cancellation Token in C# Async fashoin way
public class Foo
{
private CancellationTokenSource _cts;
public Foo()
{
this._cts = new CancellationTokenSource();
}
public void StartExecution()
@lucamilan
lucamilan / LoopStep.cs
Created April 18, 2021 08:04 — forked from jermdavis/LoopStep.cs
A possible looped pipeline step for processing IEnumerable<> inputs
using System.Collections.Generic;
namespace StronglyTypedPipelines
{
public class LoopStep<INPUT,OUTPUT> : IPipelineStep<IEnumerable<INPUT>, IEnumerable<OUTPUT>>
{
private IPipelineStep<INPUT, OUTPUT> _internalStep;
public LoopStep(IPipelineStep<INPUT, OUTPUT> internalStep)
using System;
namespace StronglyTypedPipelines
{
public abstract class BasePipelineStep<INPUT, OUTPUT> : IPipelineStep<INPUT, OUTPUT>
{
public event Action<INPUT> OnInput;
public event Action<OUTPUT> OnOutput;
// note need for descendant types to implement this, not Process()
@lucamilan
lucamilan / BasePipelineTypes.cs
Created April 18, 2021 08:03 — forked from jermdavis/BasePipelineTypes.cs
An example of strongly typed data pipelines, with some trivial examples
using System;
namespace StronglyTypedPipelines
{
/// <summary>
/// Base type for individual pipeline steps.
/// Descendants of this type map an input value to an output value.
/// The input and output types can differ.
/// </summary>
@lucamilan
lucamilan / fil01.ps1
Created February 17, 2021 08:41
Cleanup Docker Images
# remove dangling images
docker rmi -f $(docker images -f dangling=true -q)
# remove dangling volumes
docker volume rm $(docker volume ls -qf dangling=true)