Skip to content

Instantly share code, notes, and snippets.

@jlcs-es
jlcs-es / Habitacion3.sol
Last active October 11, 2025 08:57
MIAX 13 Sesion III
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
contract Ownable {
address owner;
constructor() {
owner = msg.sender;
}
@jlcs-es
jlcs-es / EjercicioVehiculo.sol
Created October 11, 2025 07:25
MIAX 13 sesion II
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
contract Ownable {
address payable owner;
constructor() {
owner = payable(msg.sender);
}
@jlcs-es
jlcs-es / 2_deploy_contracts.js
Last active April 5, 2024 14:48
Sesion VI MIAX 11
const EuroTokenizado = artifacts.require("EuroTokenizado");
const RegistroTrafico = artifacts.require("RegistroTrafico")
const Concesionario = artifacts.require("Concesionario")
module.exports = async function(deployer, network, accounts) {
const euro = accounts[0];
const trafico = accounts[1];
const concesionario = accounts[2];
await deployer.deploy(EuroTokenizado, {from: euro});
@jlcs-es
jlcs-es / AuctionPush.sol
Last active March 23, 2024 12:33
MIAX 11 23 marzo
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.4;
contract Auction {
address payable public winner;
uint public mostSent;
/// The amount of Ether sent was not higher than
/// the currently highest amount.
error NotEnoughEther();
@jlcs-es
jlcs-es / keybase.md
Created January 19, 2023 11:53
keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@jlcs-es
jlcs-es / Share full screen on Slack.md
Created May 13, 2022 08:20
Ubuntu 22.04 Wayland Share full screen on Slack

The easiest option is to install the flatpack version, because it enables wayland support by default.

Install flatpack: sudo apt install flatpak

Install slack: flatpak install flathub com.slack.Slack

Reboot so the new environment variables are catched up and the slack icon appears in the apps menu.

@jlcs-es
jlcs-es / Share full screen on Chrome.md
Last active May 13, 2022 08:22
Ubuntu 22.04 Wayland Share full screen on Chrome

Because Wayland is now the default on Ubuntu 22.04, the apps must use pipewire to share the full screen, otherwise, it will only be a black screen with the mouse on it.

On chrome go to chrome://flags/#enable-webrtc-pipewire-capturer to enable the WebRTC PipeWire support.

Install if needed: sudo apt install xdg-desktop-portal-gnome

@jlcs-es
jlcs-es / scrypt.go
Created November 15, 2019 11:46
Go implementation of Scrypt Key Derivation Function. Tested with barrysteyn/node-scrypt 's verifyKdf()
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"fmt"
"golang.org/x/crypto/scrypt"
"math/rand"
"os"
#!/bin/bash
# Generate a CA root certificate
## $1: Subject Name, e.g. C=BE,O=GlobalSign,OU=Root CA,CN=GlobalSign Root CA
## $2 [optional]: PathLen, default: 1
generate_CA_certificate() {
# gen key
openssl ecparam -name prime256v1 -genkey -out private-key.pem -noout
# req
@jlcs-es
jlcs-es / bioperl.sh
Last active February 26, 2019 17:08
Execute bioperl within docker with non-root but sudo privileges and shared directory in home
docker run -ti --rm --name bioperl -v ~/bioperl:/home/bioperl -w /home/bioperl bioperl/bioperl bash -c "\
adduser --disabled-password --gecos '' bioperl --no-create-home --home /home/bioperl &&\
adduser bioperl sudo &&\
chown -R bioperl:bioperl /home/bioperl &&\
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers &&\
su -m bioperl -c bash"