Skip to content

Instantly share code, notes, and snippets.

View manio143's full-sized avatar

Marian Dziubiak manio143

View GitHub Profile
@manio143
manio143 / NUnitAttributes.md
Last active May 18, 2016 08:05
Usefull NUnit Attributes

Usefull NUnit Attributes

Attribute Description
[Category(string)] Specifies one or more categories for the test.
[Description(string)] Applies descriptive text to a Test, TestFixture or Assembly.
[Explicit] Indicates that a test should be skipped unless explicitly run.
[Ignore]
[Maxtime(milliseconds)] Specifies the maximum time in milliseconds for a test case to succeed.
[Order(int)] Specifies the order in which decorated test should be run (against others).
@manio143
manio143 / DesertEx.tmTheme
Created February 10, 2017 22:02
Visual Studio Code theme - DesertEx+ (DesertEx with F# additions)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>author</key>
<string>Dylan Sarber (Originally by Ming Bai on Vim) modified by Marian Dziubiak</string>
// F#+ sample monad usage
#r "FSharpPlus.dll"
open FSharpPlus
open FSharpPlus.Data
//open FSharpPlus.Operators
let s9 = Some 9
let add5divXmul2 (o : int option) x = monad {
@manio143
manio143 / ddns.py
Created January 19, 2019 13:21
A nice script to auto update DNS records in CloudFlare
#!/usr/bin/env python3
import requests
import json
import subprocess
home = "/home/manio/"
authKey = ""
email = ""
@manio143
manio143 / AsyncState.fs
Created February 17, 2019 20:17
F# implementation of (StateT s Async)
module AsyncState
type AsyncState<'s, 'a> = private AsyncState of ('s -> Async<'s * 'a>)
module AsyncState =
//Monad
let result x = AsyncState <| fun s -> async {return (s, x)}
let run (AsyncState f) = f
let bind f m = AsyncState <| fun s -> async {
let! (s', a) = run m s
@manio143
manio143 / zaufany_signer.py
Created June 10, 2019 12:54
Skrypt, który teoretycznie ma nieco przyśpieszyć podpisywanie plików profilem zaufanym przez portal obywatel.gov.pl
#!/usr/bin/env python3
import requests
import json
import sys
import os.path
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from http.cookiejar import Cookie
@manio143
manio143 / Option.cs
Created May 5, 2020 20:22
C# Sum algebraic types
using System;
namespace SumTypes
{
public abstract class Option<T> : SumType<Option<T>.Enum>
{
public enum Enum { None = 0, Some = 1 }
private Option(Enum tag) : base(tag) { }
public sealed class None : Option<T>
{
@manio143
manio143 / stride_linux.md
Last active November 4, 2020 17:49
How to build Stride for Linux

Stride uses the MSBuild system to the max. This is an instruction on how to build Stride packages so that they can be used under Linux to compile a project (excluding asset compilation).

In /build/Stride.build are the definitions of builds for different platforms/graphics systems. I will be invoking the build for Linux OpenGL, so I'm going to invoke a command

msbuild .\Stride.build /target:BuildLinux

This command should be invoked from the Visual Studio 2019 Developer PowerShell, so that all environment variables are properly set. Best open it from Visual Studio (Ctrl+Q -> PowerShell).

@manio143
manio143 / StrideRoslynFHL22.md
Last active March 24, 2022 22:12
Plans for Stride Roslyn extension for Spring FHL

Creating a Roslyn extension for Stride.Core

This project is meant to be a learning opportunity for me, to dive deeper into Roslyn analyzers and code generators. During my FHL week (21-25.03.2022) I will learn how analyzers and code generators work, when in the compilation pipeline they're invoked, how to write them and how to debug them.

Goals

The project has a goal - create a new package for Stride Stride.Core.Compilation under netstandard2.0 which will supersede AssemblyProcessor in the following:

DataSerializer generation