Skip to content

Instantly share code, notes, and snippets.

View vilinski's full-sized avatar
☣️
toxic

Andreas Vilinski vilinski

☣️
toxic
View GitHub Profile
#!/usr/bin/env bash
TOOLS=/tools
echo "download dotnet diagnostic tools"
mkdir "$TOOLS"
chmod 777 $TOOLS
cd "$TOOLS"
tools="dump gcdump source stack trace counters monitor sos"
for t in $tools; do wget -O $TOOLS/dotnet-$t https://aka.ms/dotnet-$t/linux-musl-x64; done;
chmod +x $TOOLS/dotnet-*
@vilinski
vilinski / Fake.setScriptContext.fsx
Last active November 29, 2021 14:48
FAKE script execution context - allows to run fake script with fsi
#r "nuget: System.Reactive" // workaround for System.IO.FileNotFoundException: Could not load file or assembly
#r "nuget: Fake.Core.Target"
open System
open Fake.Core
let setScriptContext isCached scriptFile =
System.Environment.GetCommandLineArgs()
|> Array.skip 2 // skip fsi.exe; *.fsx
|> Array.toList
open System
type User = string
type Title = string
type BugState =
| New
| Assigned of User
| Deferred
| Closed
type Bug =
{ Id : Guid
@vilinski
vilinski / .gitconfig
Created March 8, 2019 11:40
git cleanup
[alias]
# view list of merged feature branches
lscleanup = "!git branch -r --merged | grep -e 'feature\\|component' | sed 's/origin\\///'"
# delete merged feature branches local and on origin
cleanup = "!git branch -r --merged | grep -e 'feature\\|component' | sed 's/origin\\///' | xargs -n 1 git push --delete origin"
@vilinski
vilinski / .vimrc
Created October 12, 2018 14:41
.vimrc file with a few basic options
syntax on
set expandtab
set smarttab
set shiftwidth=4
set tabstop=4
set smartindent
set ignorecase
set nohlsearch
set incsearch
set smartcase
@vilinski
vilinski / doobie_free.scala
Created July 17, 2018 09:16
doobie batch insert large rows
import cats._
import cats.implicits._
import doobie._
import doobie.implicits._
def setIntOpt(n: Int, v: Option[Int]): PreparedStatementIO[Unit] =
v match {
case None => FPS.setNull(n, java.sql.Types.INTEGER)
case Some(s) => FPS.setInt(n, s)
}
@vilinski
vilinski / ffmpeg-avchd-conversion.md
Created June 24, 2018 18:42 — forked from trisweb/ffmpeg-avchd-conversion.md
ffmpeg commands for converting AVCHD-Lite video to better format(s)

FFMpeg Commands for Transcoding MTS video (from AVCHD-Lite Cameras, like Panasonic DMC-TS1/2)

720p -> H.264 (x264) video + AAC 128kbps audio:

Medium quality 720p:

ffmpeg -i 00001.MTS -threads 3 -y -vcodec libx264 -sameq -acodec libfaac -ab 128k -ar 44100 -ac 2 -s 1280x720 -vpre normal -b 1M output.mp4

High quality 720p:

@vilinski
vilinski / create_sln.sh
Last active December 27, 2017 19:49
bash script creating solution with two fsharp projects - console app and test project, using dotnet cli
#!/usr/bin/env bash
NAME=myprog
TEMPLATE=console
# create solution file
dotnet new sln -n $NAME
# create console project
dotnet new console -lang F# -n $NAME -o src/$NAME
@vilinski
vilinski / FSharp.sln.with.Expecto.md
Created February 16, 2017 14:10
Steps to create a .NET core solution with console and Expecto test projects in F#

Steps to create a solution

# create a solution
dotnet new sln

dotnet new console -lang f# -o src/Kraken
dotnet remove src/Kraken/Kraken.fsproj package Microsoft.FSharp.Core.netcore
dotnet add src/Kraken/Kraken.fsproj package FSharp.Core
dotnet add src/Kraken/Kraken.fsproj package MongoDB.Driver.GridFS
@vilinski
vilinski / gist:6452276
Created September 5, 2013 16:08
dupfinder.cmd
pushd "C:/Projects/Software/Dev/"
"C:\Tools\jb-commandline-8.0.0.39\dupfinder.exe" /idle-priority /show-stats /show-text /debug /normalize-types /exclude-code-regions="Windows Form Designer generated code;Component Designer generated code" /o="dupfinder.%date%.xml" /e="**/*.Designer.cs;**/*.generated.cs;**/Model.cs;**/Reference.cs" "C:/Projects/Software/Dev/SolutionName.sln"
popd