Skip to content

Instantly share code, notes, and snippets.

View yongkangc's full-sized avatar
🎃
Focusing

Chia Yong Kang yongkangc

🎃
Focusing
View GitHub Profile
@yongkangc
yongkangc / AwesomeButtonActivity_2.java
Last active February 3, 2019 11:07 — forked from CodyEngel/AwesomeButtonActivity_2.java
OnClickMethod-Android
public class AwesomeButtonActivity extends AppCompatActivity {
private Button awesomeButton;
private View.OnClickListener awesomeOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
awesomeButtonClicked();
}
};
public class AwesomeButtonActivity extends AppCompatActivity {
private Button awesomeButton;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
awesomeButton = new Button(this);
awesomeButton.setOnClickListener(new View.OnClickListener() {
@yongkangc
yongkangc / pipenv_cheat_sheet.md
Last active January 16, 2020 14:37 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@yongkangc
yongkangc / SimpleRewards.sol
Created June 21, 2022 15:28 — forked from Markkop/SimpleRewards.sol
A staking contract using a loop to save rewards data for each staker
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./RewardToken.sol";
contract StakingManager is Ownable{

Feel free to copy and paste this list into a README, issue or elsewhere in your project.

Audit prep checklist (reference)

  • Documentation (A plain english description of what you are building, and why you are building it. Should indicate the actions and states that should and should not be possible)
    • For the overall system
    • For each unique contract within the system
  • Clean code
  • Fix compiler warnings

Feel free to copy and paste this list into a README, issue or elsewhere in your project.

Audit prep checklist (reference)

  • Documentation (A plain english description of what you are building, and why you are building it. Should indicate the actions and states that should and should not be possible)
    • For the overall system
    • For each unique contract within the system
  • Clean code
  • Fix compiler warnings