Skip to content

Instantly share code, notes, and snippets.

View EngEryx's full-sized avatar
🤖
Helping Machines Learn

Eric K EngEryx

🤖
Helping Machines Learn
  • Kenya
View GitHub Profile
import React, { useState, useEffect } from "react";
import "semantic-ui-css/semantic.min.css";
import { Button, Icon } from "semantic-ui-react";
import "./cart.css";
function AddToCart({ products, handleChange }) {
const [cartItems, setCartItems] = useState([]);
const [subtotal, setSubtotal] = useState(0);
const [selectedItem, setSelectedItem] = useState(null);
@EngEryx
EngEryx / README.md
Created May 10, 2022 17:57 — forked from qdm12/README.md
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.

Assumptions

This should fit most setups (not mine though 😉)

@EngEryx
EngEryx / my_graph_db.py
Created September 6, 2021 19:16
Dictionary as my naive graph db
# This is a sample Python script.
# Eng Eryx
my_graph_db = dict({'n': 0})
def insert(item):
n = my_graph_db['n'] + 1
# Install git-semver https://github.com/hartym/git-semver
pip install git-semver
# Cd to your cool project
cd semver101
# Assuming it's the first time with tags
git tag -am 0.1.0 "Cool project's version 0.1.0"
# Checkout tags with git-semver, she's your new magic wand from now on
@EngEryx
EngEryx / Hospital.sol
Created February 16, 2019 22:35
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.5.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity ^0.5.0;
contract Hospital {
address owner;
struct Patient {
index uint;
name string;
}
Patient
@EngEryx
EngEryx / hosts.php
Created September 26, 2018 09:54
Helper functions you could consider
if(! function_exists('client_app')){
/*
* Get the client application instance.
*
*/
function client_app(){
$hostname = mnet_client();
$client = \App\Models\Client\Client::where('hostname_id',$hostname->id)->first();
return $client;
}