Skip to content

Instantly share code, notes, and snippets.

View Oliver-ke's full-sized avatar
💭
-code -eat -sleep -repeat

Azorji Kelechi Oliver Oliver-ke

💭
-code -eat -sleep -repeat
View GitHub Profile
@Oliver-ke
Oliver-ke / task.yaml
Last active December 22, 2022 00:04
Task definition for ECS
{
"containerDefinitions": [
{
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/api",
"awslogs-create-group": "true",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "ecs"
@Oliver-ke
Oliver-ke / aws_ec2_ubuntu_userdata_docker.sh
Created June 1, 2022 08:29 — forked from gonzaloplaza/aws_ec2_ubuntu_userdata_docker.sh
Script to auto install Docker (last version) into AWS EC2/Ubuntu instance at launch time: User Data
#!/bin/bash
# Install docker
apt-get update
apt-get install -y cloud-utils apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get update
@Oliver-ke
Oliver-ke / tmux-cheatsheet.markdown
Created April 17, 2022 02:39 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Oliver-ke
Oliver-ke / kata.md
Last active April 8, 2022 10:35
My daily kata

Two Sums

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

var twoSum = function(nums, target) {
    for (let i = 0; i < nums.length; i++) {
        const num = nums[i];
        const rest = nums.slice(i+1);
        for(let m = 0; m < rest.length; m++) {
            const subNum = rest[m];
            if(subNum + num === target) {
name: Frontend Cloudfront Deployment
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
@Oliver-ke
Oliver-ke / fundme.sol
Created December 27, 2021 13:12
Basic solidity code to fund account
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
contract FundMe {
mapping(address => uint256) public addressToAmountFunded;
address[] public funders;
address public owner;
address public ethFeedAddr = 0x9326BFA02ADD2366b30bacB125260Af641031331;
@Oliver-ke
Oliver-ke / .deps...remix-tests...remix_accounts.sol
Created December 9, 2021 05:52
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
library TestsAccounts {
function getAccount(uint index) pure public returns (address) {
address[15] memory accounts;
accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;
@Oliver-ke
Oliver-ke / .deps...remix-tests...remix_accounts.sol
Created December 5, 2021 21:50
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
library TestsAccounts {
function getAccount(uint index) pure public returns (address) {
address[15] memory accounts;
accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;
@Oliver-ke
Oliver-ke / Subject under test
Created March 9, 2021 11:25 — forked from mauricedb/Subject under test
Testing stateful React hooks
import { useState } from 'react';
export function useCounter(initial = 0) {
const [count, setCount] = useState(initial);
return [count, () => setCount(count + 1)];
}