Skip to content

Instantly share code, notes, and snippets.

View lrazovic's full-sized avatar
🎯
Focusing

Leonardo Razovic lrazovic

🎯
Focusing
  • Polimec Foundation
  • Zug, Switzerland
  • X @lrazovic
View GitHub Profile
@lrazovic
lrazovic / main.ts
Created February 13, 2024 13:21
Generate X Polkadot/Substrate Accounts
import { Keyring } from "npm:@polkadot/ui-keyring";
import { cryptoWaitReady } from "https://deno.land/x/polkadot@0.2.45/util-crypto/crypto.ts";
import { mnemonicGenerate } from "https://deno.land/x/polkadot@0.2.45/util-crypto/mnemonic/index.ts";
// generate a random mnemonic, 12 words in length
const MNEMONIC = mnemonicGenerate(12);
console.log(MNEMONIC);
cryptoWaitReady().then(async () => {
// load all available addresses and accounts;
//! In Module 1, we discussed Block ciphers like AES. Block ciphers have a fixed length input.
//! Real wold data that we wish to encrypt _may_ be exactly the right length, but is probably not.
//! When your data is too short, you can simply pad it up to the correct length.
//! When your data is too long, you have some options.
//!
//! In this exercise, we will explore a few of the common ways that large pieces of data can be broken
//! up and combined in order to encrypt it with a fixed-length block cipher.
//!
//! WARNING: ECB MODE IS NOT SECURE.
//! Seriously, ECB is NOT secure. Don't use it irl. We are implementing it here to understand _why_ it
@lrazovic
lrazovic / rsa.c
Last active February 28, 2022 11:37
#include <math.h>
#include <stdio.h>
int primo(int a) {
int i;
int r = (int)sqrt(a);
for (i = 2; i <= r; i++) {
if (a % i == 0) {
return 0; // Non primo

The easiest way to solve conflict

A stupid method that should not be used to solve conflicts, but it works.

  1. Move the current view folder to another folder, such as Desktop.
  2. Clone the repository again into a new, empty folder.
  3. Enter in development branch
  4. Move the view folder you saved earlier to where the new cloned view folder is, overwrite all the files in the view folder.
  5. Now you can commit and push your changes

Keybase proof

I hereby claim:

  • I am lrazovic on github.
  • I am lrazovic (https://keybase.io/lrazovic) on keybase.
  • I have a public key ASCPvStWVdiOE0n5gS3q0LhrgxvYHODUDF_MAVYWHWqpYQo

To claim this, I am signing this object:

body {
background-color: #dad4ce;
background-image: url(/images/arancia_2.jpg);
}
.navbar-default {
background-color: #f7f7f7;
}
.searchbar {
margin-top: 5%;
margin-left: 15%;
function initializeStorage() {
if (typeof localStorage.recipes == "undefined") {
localStorage.recipes = "[]";
}
if (localStorage.recipes == "[]") {
$("#localStorage").css("display", "none");
}
if (localStorage.recipes != "[]") {
printStorage();
}
<!DOCTYPE html>
html(lang="en")
head
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1")
meta(http-equiv="X-UA-Compatible", content="ie=edge")
link(rel='stylesheet', href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css")
script(src='https://code.jquery.com/jquery-3.3.1.slim.min.js', integrity='sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo', crossorigin='anonymous')
script(src="/javascript/search.js")
link(rel="stylesheet", href="/stylesheets/search.css")
@lrazovic
lrazovic / alacritty.yml
Created October 11, 2018 09:40
alacritty macOS ZSH
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
{
"workbench.startupEditor": "newUntitledFile",
"terminal.integrated.fontSize": 14,
"terminal.integrated.fontFamily": "Fira Mono for Powerline",
"editor.fontSize": 15,
"C_Cpp.clang_format_style": "{ BasedOnStyle: Google, IndentWidth: 4 }",
"editor.fontFamily": "Fira Mono, Menlo, Monaco, 'Courier New', monospace",
"editor.minimap.enabled": false,
"extensions.ignoreRecommendations": false,
"git.autofetch": true,