Skip to content

Instantly share code, notes, and snippets.

View AlbertoDePena's full-sized avatar

Alberto De Pena AlbertoDePena

  • Crane Worldwide Logistics
  • Willis, TX
View GitHub Profile
FROM mcr.microsoft.com/windows/servercore:1809
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV ERLANG_VERSION="22.1" \
ERLANG_HOME="C:\\erlang" \
RABBITMQ_VERSION="3.8.1" \
RABBITMQ_HOME="C:\\rabbitmq"
COPY otp_win64_22.1.exe .
FROM mcr.microsoft.com/windows/servercore:1809 as installer
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
COPY node-v12.13.1-win-x64.zip .
RUN Expand-Archive C:\node-v12.13.1-win-x64.zip -DestinationPath C:\; \
Rename-Item C:\node-v12.13.1-win-x64 C:\nodejs
FROM mcr.microsoft.com/windows/nanoserver:1809
worker_processes 1;
daemon off;
events {
worker_connections 1024;
}
http {
include mime.types;
FROM mcr.microsoft.com/windows/servercore:1809
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV NGINX_VERSION 1.17.6
RUN Invoke-webrequest http://nginx.org/download/nginx-1.17.6.zip -UseBasicParsing -outfile C:\nginx.zip ; \
Expand-Archive C:\nginx.zip -DestinationPath C:\nginx
WORKDIR C:\\nginx\\nginx-1.17.6
@AlbertoDePena
AlbertoDePena / Console.fs
Last active February 25, 2020 02:26
Thread safe, colored console
[<RequireQualifiedAccess>]
module Console =
open System
let private log =
let lockObj = obj()
fun color text ->
lock lockObj (fun _ ->
Console.ForegroundColor <- color
printfn "%s" text
[<RequireQualifiedAccess>]
module Async =
open System
open System.Threading
open System.Threading.Tasks
let singleton x = async {
return x
}
@AlbertoDePena
AlbertoDePena / Dapper.fs
Created July 16, 2019 13:40
Dapper with FSharp
open System
open System.Collections.Generic
open System.Data.SqlClient
open Dapper
open System.Data
open FSharp.Control.Tasks.V2.ContextInsensitive
let ExitCode = 0
let DbConnectionString = "Server=localhost;Database=EventStore;Trusted_Connection=True;"
@AlbertoDePena
AlbertoDePena / Program.cs
Created March 8, 2019 21:41
Gracefully exit dotnet console app in docker container
using System;
using System.Threading;
using System.Threading.Tasks;
namespace GracefulExit
{
class Program
{
// AutoResetEvent to signal when to exit the application.
private static readonly AutoResetEvent waitHandle = new AutoResetEvent(false);
import babel from 'rollup-plugin-babel';
import common from 'rollup-plugin-commonjs';
import copy from 'rollup-plugin-copy';
import resolve from 'rollup-plugin-node-resolve';
export default {
input: 'src/index.js',
output: {
file: 'dist/index.js',
format: 'esm'
Param
(
[String]
$OutputDirectory = $(Throw "The output directory was not specified."),
[String]
$PackDirectory = $(Throw "The pack directory was not specified.")
)
try {
Write-Output "Packaging azure functions..."