Skip to content

Instantly share code, notes, and snippets.

View akrisiun's full-sized avatar

Andrius K akrisiun

View GitHub Profile

https://element-plus.org/#/en-US/component/menu

@import url("//unpkg.com/element-plus/lib/theme-chalk/index.css");

<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
  <el-menu-item index="1">Processing Center</el-menu-item>
  <el-submenu index="2">
    <template #title>Workspace</template>
    <el-menu-item index="2-1">item one</el-menu-item>

Github gists api: per_page=, page=

GET /gists
Parameters
Name	Type	In	Description
-----|-----|---------------
accept	string	header	
Setting to application/vnd.github.v3+json is recommended.
since	string	query	
@akrisiun
akrisiun / parseHash_URIComponent.md
Created February 17, 2021 14:28
location.hash.slice + JSON.parse(decodeURIComponent - as window.__args__

parseHash_URIComponent - for NodeJs / Electron

// executed in context of window renderer
function parseArgs () {
  if (!window.location.hash) {
    window.__args__ = {}
  } else {
    var hash = window.location.hash.slice(1)
 window.__args__ = Object.freeze(JSON.parse(decodeURIComponent(hash)))
@akrisiun
akrisiun / async-fetch.md
Created February 12, 2021 21:06
async fetch
@akrisiun
akrisiun / UploadRequestAsync.md
Last active July 27, 2020 11:45
UploadRequestAsync C# task

https://stackoverflow.com/questions/63062474/asynchrounous-chunked-file-upload-in-c-sharp

// Call to chunk and upload file in another async method. I'm only showing the call here:
FileStream fileStream = new FileStream(fileNameIn, FileMode.Open, FileAccess.Read);
await ChunkFileAsync(fileStream, uploadFile.Name, url);

UploadFile.cs

// To upload chunks to remote server
        public static async Task<bool> UploadRequestAsync(string fileName, string url, int loopCounter, Byte[] bytes)
@akrisiun
akrisiun / gist:7440d84138c91ca23d7a33921053659f
Last active December 1, 2023 20:49 — forked from nikhilgeo/gist:911b76faf3e965143128a7ccb74772c9
Create CA and self-signed cert X.509 v3

1 Create CA

1.1 Create keys

openssl genrsa -out rootCA_key.key 2048. 
	-des3 algorithm to encrypt the key and will require you to enter a password in order for the key file to be created.
1.2 Create Root CA cert with constraint CA = true. 
openssl req -x509 -new -nodes -key rootCA_key.key -sha256  -days 1024  -out rootCA_crt.pem \ 
 -extensions v3_ca -reqexts v3_req -config /usr/local/etc/openssl/openssl.cnf
@akrisiun
akrisiun / self-signed-certificate-with-custom-ca.md
Created July 26, 2020 13:03 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096