Skip to content

Instantly share code, notes, and snippets.

@PadreSVK
PadreSVK / enumsample.cpp
Created October 13, 2020 13:54
Enum sample
// cv042.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include "test.h"
enum enum_name
{
element1,
element2,
@PadreSVK
PadreSVK / .gitconfig
Last active September 29, 2020 11:19
Git configuration for more organizations/git profiles
[user]
email = patrik.svikruha@gmail.com
name = Patrik Svikruha
[credential]
helper = wincred
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
async update({ commit }, { token, password })
{
const result = await axios.put(
passwordChangeUrl,
{ token, password },
{ validateStatus: status => status === 404 || status === 400 }
)
switch (result.status) {
case 404:
commit("login is expired")
{
"test": 555,
"content": {
"name": "AAA",
"age": 55
}
}
@PadreSVK
PadreSVK / Program.cs
Created March 16, 2020 22:03
Program.cs
internal class Program
{
#pragma warning disable VSTHRD200
private static async Task Main(string[] args)
{
await Task.CompletedTask;
Console.WriteLine("Hello World!");
}
#pragma warning restore VSTHRD200
}
@PadreSVK
PadreSVK / Directory.Build.props
Created March 16, 2020 16:34
Directory.Build.props
<Project>
<PropertyGroup>
<LangVersion>preview</LangVersion> <!--Set C# version for every projects-->
<Nullable>enable</Nullable> <!--Enable nullable for projects-->
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Solution.ruleset</CodeAnalysisRuleSet> <!--Path to Solution.ruleset config for analyzers-->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="16.5.132" /> <!--some analyzer from nuget https://www.nuget.org/packages/Microsoft.VisualStudio.Threading.Analyzers/ -->
</ItemGroup>
@PadreSVK
PadreSVK / extensions.ps1
Created March 6, 2020 12:12
Recommend extesions
# sync settings for vscode based on github gists
code --install-extension shan.code-settings-sync
# vuejs extesion
code --install-extension octref.vetur
# javascript/typescript playground https://quokkajs.com/
code --install-extension wallabyjs.quokka-vscode
# liveshare for vscode => welcome eXtreme programming
@PadreSVK
PadreSVK / script.py
Created January 7, 2020 21:26
low pass
import pandas as pd
import csv
import matplotlib.pyplot as plt
from scipy import signal
x = []
y = []
z = []
xOffset = None
@PadreSVK
PadreSVK / Startup.cs
Created December 16, 2019 05:02
Register cookie auth in startup
///
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
.AddCookie();
services.ConfigureApplicationCookie(options =>