Skip to content

Instantly share code, notes, and snippets.

View enumsample.cpp
// 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 Sep 29, 2020
Git configuration for more organizations/git profiles
View .gitconfig
[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
View aaa.js
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")
View test.json
{
"test": 555,
"content": {
"name": "AAA",
"age": 55
}
}
View 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
}
View 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 Mar 6, 2020
Recommend extesions
View extensions.ps1
# 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
View script.py
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 Dec 16, 2019
Register cookie auth in startup
View Startup.cs
///
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
.AddCookie();
services.ConfigureApplicationCookie(options =>
You can’t perform that action at this time.