Skip to content

Instantly share code, notes, and snippets.

View milaabl's full-sized avatar
🇺🇦
🇧🇬

Ludmila milaabl

🇺🇦
🇧🇬
View GitHub Profile
@milaabl
milaabl / App.tsx
Created August 5, 2023 11:19
E2E RSA + AES encryption system (symmetric+asymmetric encryption for sensitive data transfers) | React, CryptoJS & Shell .sh (OpenSSL)
import CryptoJS from 'crypto-js';
import './app.css';
import FileInput from "./components/FileInput/FileInput";
import { FC, useEffect, useState } from "react";
const getAESEncrypted = (secret: string, password: string) => {
const encrypted = CryptoJS.AES.encrypt(secret, password);
return encrypted.toString();
}
<script>
import Web3 from 'web3'
export default ({
data() {
return {
buttonDisabled: false,
buttonInstallText: "Click here to install Metamask",
}
},
@farhan-raza
farhan-raza / MDtoImage.cs
Created December 13, 2020 22:40
Convert Markdown (MD) to PDF or PNG, JPG Image Programmatically using C#
// Prepare a simple Markdown example
var code = "### Hello World" +
"\r\n" +
"[visit applications](https://.aspose.com)";
// Create a Markdown file
System.IO.File.WriteAllText(dataDir + "document.md", code);
// Convert Markdown to HTML document
using (HTMLDocument document = Aspose.Html.Converters.Converter.ConvertMarkdown(dataDir + "document.md"))
{
@cameel
cameel / solidity-enums-with-data.md
Last active September 5, 2024 13:11
Enums with data in Solidity

Use cases

  • Optional/nullable data types.
  • Variant data types.
  • Flag with extra information needed only in some cases (or different in different cases).
  • Modeling states in a state machine where each state can have some data associated with it.
  • List of operations for batch processing, where each operation can have its own arguments.
  • Alternative to function overloading that allows avoiding combinatorial explosion when there are multiple parameters that need variants.
  • Nested data structures with heterogenous nodes.

Syntax and semantics

@OlehDutchenko
OlehDutchenko / next.config.js
Last active April 2, 2022 19:19
Example for the next.config.js to enable typescript errors check in dev mode
// -----------------------------------------------------------------------------
// Deps
// -----------------------------------------------------------------------------
const fromCWD = require('from-cwd');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const PnpWebpackPlugin = require('pnp-webpack-plugin');
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants');
// -----------------------------------------------------------------------------
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active December 28, 2024 13:08
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@tjade273
tjade273 / Database.sol
Last active April 6, 2024 04:32
Example of separated storage and logic
contract Database{
mapping(uint => uint) public _data;
mapping(address => bool) _owners;
function Database(address[] owners){ //Called once at creation, pass in initial owners
for(uint i; i<owners.length; i++){
_owners[owners[i]]=true;
}
}