Skip to content

Instantly share code, notes, and snippets.

View btshft's full-sized avatar
🌚
What's happening?

Igor Polyakov btshft

🌚
What's happening?
  • 340Basics
View GitHub Profile
@btshft
btshft / Dockerfile
Created July 2, 2020 12:26
Scan typescript app
FROM node:lts-buster
# Install OpenJDK-11
RUN apt-get update && \
apt-get install -y openjdk-11-jdk && \
apt-get install -y ant && \
apt-get clean;
# Fix certificate issues
RUN apt-get update && \
@btshft
btshft / swagger.json
Created June 30, 2020 20:53
Zeus API
{
"openapi": "3.0.1",
"info": {
"title": "Zeus API",
"version": "1.0"
},
"paths": {
"/api/v{version}/webhook/alerts/{channel}": {
"post": {
"tags": [
@btshft
btshft / swagger.json
Created June 18, 2020 17:46
counters draft
{
"openapi": "3.0.1",
"info": {
"title": "Counters API",
"version": "v1"
},
"paths": {
"/Counters/simple/{name}/increment/{key}": {
"post": {
"tags": [
@btshft
btshft / schema.json
Created June 18, 2020 15:18
api schema
{
"openapi": "3.0.1",
"info": {
"title": "Counter API Service",
"version": "v1"
},
"paths": {
"/api/Counters/trades/{key}": {
"get": {
"tags": [
@btshft
btshft / clair.txt
Last active June 14, 2020 12:53
aspnet:3.0-buster-slim docker image test
PS C:\Users\Canyon\Desktop\clair> ./clair-scanner --ip="host.docker.internal" --threshold=Medium --reportAll=false mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim
2020/06/14 15:48:52 [INFO] ▶ Start clair-scanner
2020/06/14 15:49:16 [INFO] ▶ Server listening on port 9279
2020/06/14 15:49:16 [INFO] ▶ Analyzing 3e29b193cb0e97576e20170819724cf94c46c8d745136268e355db1342221572
2020/06/14 15:49:24 [INFO] ▶ Analyzing 8981bb2400b54d954b70d8ecba0263836c72a4972ea60ae97aada1e17abe55fd
2020/06/14 15:49:27 [INFO] ▶ Analyzing cc10d7b72900931720971363ad251b38010acdd0330d7eabbb8394b451a8605b
2020/06/14 15:49:28 [INFO] ▶ Analyzing 6bab8815017212e88c871defec5af1d055149451a9d8f8ad4db8e8884dcb748f
2020/06/14 15:49:33 [INFO] ▶ Analyzing 3d730628ca3d8c420c4caa52b02fb28019d05b02ee86566e85a42e3da1608830
2020/06/14 15:49:34 [WARN] ▶ Image [mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim] contains 66 total vulnerabilities
2020/06/14 15:49:34 [ERRO] ▶ Image [mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim] contains 10 un
@btshft
btshft / asdfsf.cs
Created May 22, 2020 09:55
asfsdfsdf
public class Procedure
{
}
public class EvaluatedUrlBuildRequirement
{
public Procedure EvaluatedOn { get; }
public bool IsSatisfied { get; }
public Type RequirementType { get; }
private initNullProperties(target : any, source: any){
let self = this;
Object.keys(target).forEach(targetKey =>{
if(target[targetKey] === null && source!== null && typeof source !== "undefined" && source[targetKey] !== null && typeof source[targetKey] === "object"){
target[targetKey] = source[targetKey];
}
else if(target[targetKey] !== null && typeof target[targetKey] === "object" && source!== null && typeof source !== "undefined"){
self.initNullProperties(target[targetKey], source[targetKey])
}
});
@btshft
btshft / Modification.cs
Last active March 7, 2020 21:28
Modification / EntityPatch
/// <summary>
/// Контейнер содержащий модификацию для объекта.
/// </summary>
/// <typeparam name="T">Тип объекта.</typeparam>
public class Modification<T> where T : class
{
/// <summary>
/// Модификации объекта.
/// </summary>
public ICollection<Change> Changes { get; set; } = new List<Change>();
@btshft
btshft / Example.cs
Created March 4, 2020 14:23
SomeGist
public interface IBuilder<T> where T : PurchaseDocuments
{
Entity Build(T dto);
}
public abstract class BuilderBase<T> : IBuilder<T> where T : PurchaseDocuments
{
public Entity Build(T dto)
{
var entity = new Entity();
@btshft
btshft / ICacheManager.cs
Last active May 9, 2017 20:34
Simple cache manager for .Net
using System;
namespace Cache.Contracts
{
/// <summary>
/// Менеджер для кеширования.
/// </summary>
public interface ICacheManager
{
/// <summary>