Skip to content

Instantly share code, notes, and snippets.

View casweeney's full-sized avatar
👨‍💻
Building Platforms

Coding Cas casweeney

👨‍💻
Building Platforms
View GitHub Profile
@casweeney
casweeney / git_workflow_best_practices.md
Created November 28, 2022 08:24 — forked from calaway/git_workflow_best_practices.md
Git Workflow Best Practices

Git Branch Merging Best Practices

  1. After you've selected a feature to work on, create a branch in your local repo to build it in.
    • $ git checkout -b calaway/short_description_of_feature
  2. Implement the requested feature, make sure all tests are passing, and commit all changes in the new branch.
  3. Checkout the master branch locally.
    • $ git checkout master
  4. Pull down the master branch from GitHub to get the most up to date changes from others. If you practice git workflow as described here you should never have a merge conflict at this step.
    • $ git pull origin master
  5. Make sure all tests are passing on master and then checkout your new branch.
  • $ git checkout calaway/short_description_of_feature
@casweeney
casweeney / cast.sol
Created September 16, 2022 17:51 — forked from Realkayzee/cast.sol
import "./LibCast.sol";
contract Cast{
using Arithmetic for uint;
using Arithmetic for Arithmetic.Workers;
Arithmetic.Workers aw;
uint tem;
@casweeney
casweeney / LibCast.sol
Last active September 16, 2022 17:52 — forked from Realkayzee/LibCast.sol
uint256 constant SALARY=20000;
struct Workers{
uint8 count;
string name;
}
library Arithmetic{
function add(uint a,uint b) internal pure returns(uint){
@casweeney
casweeney / English auction.sol
Created August 4, 2022 02:24 — forked from developeruche/English auction.sol
Solidity English Auction
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface IERC721 {
function safeTransferFrom(
address from,
address to,
uint tokenId
) external;
@casweeney
casweeney / btyesmanager.sol
Created August 3, 2022 15:02 — forked from developeruche/btyesmanager.sol
Explains Bytes Code and Init Code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract ByteCodeManager {
function getBytecode(address _owner, uint _foo) public pure returns (bytes memory) {
bytes memory bytecode = type(TestContract).creationCode;
return abi.encodePacked(bytecode, abi.encode(_owner, _foo));
}