Skip to content

Instantly share code, notes, and snippets.

View CodeLeom's full-sized avatar
🎯
Building

Ayodele Aransiola CodeLeom

🎯
Building
View GitHub Profile
@CodeLeom
CodeLeom / AutoDeploy.yml
Created July 4, 2023 10:35 — forked from Auwalms/AutoDeploy.yml
This action builds, authenticate and deploy an app to two seperate instances depending on the branch a push is made to.
name: api-deployment
on:
push:
branches:
- master
- stagging
jobs:
build-staging:
@CodeLeom
CodeLeom / Commit.md
Last active August 1, 2023 10:16
Git Commit Convention, using the convention for writing git-commit messages. It is based on the AngularJS project (doc, commits).

Commit Message should come with a :

This means that, whatever you are working on, fall under the category of types mentioned below.

No. Type Description
1 feat use this type to describe a new feature
2 fix use this type to describe a bug fix
3 doc use this type to describe a documentation contribution or improvement
4 style use this type to describe formatting, missing semicolons, or page styling
5 refactor use this type to describe code refactor
@CodeLeom
CodeLeom / Ownable.sol
Last active August 2, 2023 12:56
A smart contract that allows only the contract owner to perform an action
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract Ownable {
address public owner;
constructor() {
owner = msg.sender;
}
@CodeLeom
CodeLeom / todo.sol
Created August 4, 2023 11:27
A simple todo list smart contract
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
contract TodoList {
struct Todo {
string text;
bool isComplete;
}
Todo[] public todos;
@CodeLeom
CodeLeom / dual.js
Created October 24, 2023 02:48
Code Sample to handle Upload and Download action with Puppeteer
import puppeteer from 'puppeteer'
//function to handle timeout
function delay(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
@CodeLeom
CodeLeom / download.js
Created October 24, 2023 02:53
Automating Puppeteer download functionality
import puppeteer from 'puppeteer'
import * as fs from 'fs';
//function to handle timeout
function delay(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
const browser = await puppeteer.launch({
@CodeLeom
CodeLeom / upload.js
Created October 24, 2023 02:55
Automating a File Upload with Puppeteer
import puppeteer from "puppeteer";
// function to handle timeout
function delay(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
const browser = await puppeteer.launch({
headless: false
@CodeLeom
CodeLeom / index.html
Last active November 7, 2023 12:02
Explaining CSS Selectors
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=\], initial-scale=1.0">
<title>Document</title>
<style>
.box {
box-sizing: border-box;
width: 160px;
@CodeLeom
CodeLeom / inheritance.html
Created November 8, 2023 12:20
explaining Inheritance in html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inheritance</title>
<style>
/* color default is black */
html {
color: green;
@CodeLeom
CodeLeom / flexbox.html
Last active November 9, 2023 12:36
flexbox example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FlexBox & Grid</title>
<style>
.container {
display: flex;