Skip to content

Instantly share code, notes, and snippets.

View marcingolenia's full-sized avatar
🎯
Focusing

marcingolenia

🎯
Focusing
View GitHub Profile
git restore --source origin/master filename
git checkout -
git log branchB..branchA
git log --oneline --decorate
git config --global push.default current
git config --global push.autoSetupRemote true
@marcingolenia
marcingolenia / main.tf
Created February 7, 2023 12:05
Terraform for cloudrun + secrets from secret manager mounted as env variables (with loop).
# vars.tf:
variable "docker_image" {
type = string
}
variable "project_id" {
type = string
default = "{YOUR GOOGLE PROJECT ID}"
}
import React from "react";
// Import Highcharts
import Highcharts from "highcharts/highstock";
import HighchartsReact from "highcharts-react-official";
import highchartsExporting from "highcharts/modules/exporting";
import highchartsExportData from "highcharts/modules/export-data";
import highchartsAccessibility from "highcharts/modules/accessibility";
import {defaultConfig} from "@ignite-analytics/charts"
highchartsExporting(Highcharts);
const delay = (milisec: number) =>
new Promise(r => {
setTimeout(r, milisec);
});
@marcingolenia
marcingolenia / countries-utils.ts
Last active June 23, 2022 08:23
countries-utils.ts
import nationalities from 'i18n-nationality/langs/en.json'
import countries from 'i18n-iso-countries/langs/en.json'
import {
getName as getNationality,
registerLocale as registerNationality
} from 'i18n-nationality'
import {
getName as getCountry,
registerLocale as registerCountry
} from 'i18n-iso-countries'
@marcingolenia
marcingolenia / ConnectToEventStore.fs
Created April 12, 2022 08:54
Connect to secure eventstoredb in F#
open System
open System.Text
open EventStore.Client
open Xunit
[<Fact>]
let ``Connect to event store`` () =
// Arrange
let data: string = "{ \"a\":\"2\"}"
let metadata: string = "{}"
@marcingolenia
marcingolenia / Dockerfile
Last active January 19, 2022 08:43
Neo4j in docker
FROM neo4j:latest
COPY neo_import.sh neo_import.sh
COPY *.cypher .
RUN ["chmod", "+x", "neo_import.sh"]
ENTRYPOINT ["./neo_import.sh"]
module SupportOperations.TestApi
open System.Net.Http
open Microsoft.AspNetCore.Mvc.Testing
open Newtonsoft.Json
open System
open FsToolkit.ErrorHandling
open Program
let create () = (new WebApplicationFactory<Program>()).Server
@marcingolenia
marcingolenia / Dockerfile
Last active October 12, 2021 09:53
Just place the script in a folder with sql files. Optionally use docker as well :)
FROM mcr.microsoft.com/dotnet/sdk:5.0
COPY * ./
CMD ["sh", "-c", "dotnet fsi migrateDatabase.fsx \"${DB_CONNECTION}\""]
@marcingolenia
marcingolenia / DapperFSharp.fs
Created June 14, 2020 17:45
FSharpDapperWrapper
namespace FSharpDapperWrapper
open System.Data
module DapperFSharp =
open System.Data.SqlClient
open Dapper
let dbQuery<'Result> (query: string) (connection: SqlConnection): Async<'Result seq> =
connection.QueryAsync<'Result>(query) |> Async.AwaitTask