Skip to content

Instantly share code, notes, and snippets.

@YashKarthik
YashKarthik / schema1.json
Created December 2, 2023 20:34
WARG HIL testing schema
[
{
"name": "SBUS test",
"description": "description of test",
"protocol": "SBUS",
"synchronous": false,
"inputs": [
{
"signal": "0x00",
"channel": "0x00"
@YashKarthik
YashKarthik / blockchain.ts
Created April 20, 2022 11:10
Sample blockchain from fireship
import * as crypto from "crypto";
class Transaction {
constructor(
public amount: number,
public payer: string,
public payee: string
) {}
toString() {
@YashKarthik
YashKarthik / VendingMachine.sol
Last active February 12, 2022 05:37
Vending machine in solidity.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
contract VendingMachine {
mapping(string => mapping(address => uint)) public items;
// A mapping from item to a mapping of addresses containing a certain number of the items
mapping(string => uint) public prices; // mapping between itemm and its price
// stocking up the store xD
constructor() {
@YashKarthik
YashKarthik / lmaoCoin.sol
Last active February 11, 2022 12:32
Just playing with solidity.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
interface IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function totalSupply() external view returns (uint256);
function balanceOf(address _owner) external view returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
@YashKarthik
YashKarthik / PiggyBank.sol
Created February 6, 2022 08:30
Piggy bank that locks in funds for the given time and allows withdrawal by owner.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8;
contract Piggy {
address payable owner;
uint public releaseTimestamp;
constructor() payable {
owner = payable(msg.sender);
}
@YashKarthik
YashKarthik / rec_sum.py
Created September 1, 2021 11:27
Recursive summing of elements of list. Just for fun (ik sum(list) exists).
def mysum(lst, s):
while len(lst) > 0:
s += lst[0]
lst.pop(0)
s = mysum(lst, s)
return s
/* Import Fonts */
@import url("https://fonts.googleapis.com/css2?family=Varela+Round&display=swap");
/* Global Variables */
:root {
--anthonian-dark-blue: #009eff;
--anthonian-light-blue: #02ddf7;
--anthonian-primary-color: rgb(98, 49, 211);
--anthonian-anchor-active: rgb(0, 174, 255);
--anthonian-anchor: rgb(116, 165, 255);
--anthonian-anchor-hover: rgb(255, 255, 255);