Skip to content

Instantly share code, notes, and snippets.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
interface USDC {
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
@BlockmanCodes
BlockmanCodes / Staking.js
Created April 3, 2022 12:40
Deposit and withdraw ERC20 tokens (USDT, SHIB, MATIC) from a Solidity contract (Hardhat, Ethers.js)
const { expect } = require("chai");
describe('Staking', function () {
beforeEach(async function() {
[owner, wallet1, wallet2] = await ethers.getSigners();
Staking = await ethers.getContractFactory('Staking', owner);
Wbtc = await ethers.getContractFactory('Wbtc', wallet1);
staking = await Staking.deploy();
wbtc = await Wbtc.deploy();
@weihanglo
weihanglo / rust-vs-go.md
Last active July 11, 2025 13:11
【譯】Rust vs. Go

【譯】Rust vs. Go

本文譯自 Julio Merino 2018 年七月撰寫的 Rust vs. Go 一文。Julio Merino 是 G 社僱員,在 G 社工作超過 8 年,無論工作內外,都接觸開發不少 Go 語言,並撰寫 [Rust 點評][rust-review]系列文,來聽聽他對 Rust 與 Go 的想法吧。

Thanks Julio Merino for this awesome article!


@tegansnyder
tegansnyder / Preventing-Puppeteer-Detection.md
Created February 23, 2018 02:41
Preventing Puppeteer Detection

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',

【Ethereum 智能合約開發筆記】不用自己跑節點,使用 Infura 和 web3.js 呼叫合約

Infura Logo From Consensys

Infura 提供公開的 Ethereum 主網和測試網路節點。到 Infura 官網申請,只要輸入一點基本資料和 Email,就可以收到 API-key。

Infura API Key


@CodFrm
CodFrm / aes_ecb_pkcs5.php
Created December 19, 2017 05:42
PHP对接java的AES/ECB/PKCS5Padding加密方式
<?php
/**
*============================
* author:Farmer
* time:2017/12/19
* blog:blog.icodef.com
* function:加密方式
*============================
*/
@baymaxium
baymaxium / content.md
Last active March 12, 2026 13:56
机器学习实践指南

原文:Linux中国

在今天的文档中,我会列出 7 个步骤(和 50 多个资源)帮助你开启这个令人兴奋的计算机科学领域的大门,并逐渐成为一个机器学习高手。

-- Karlijn Willems

本文导航

@doggy8088
doggy8088 / Angular 18 Dev Setup.md
Last active January 26, 2026 13:41
Angular 18 開發環境說明

Angular 18 開發環境說明

為了能讓大家能夠順利的建立起 Angular 18 開發環境,以下是需要安裝的相關軟體與安裝步驟與說明。

Angular LOGO

[ 作業系統 ]

  • Windows 10 以上版本
  • Mac OS X 10.6 以上版本
@artboard-studio
artboard-studio / stackblur_filter.class.js
Last active June 14, 2019 23:56
Stack blur filter for fabricjs
/**
* Stack blur filter for fabricjs
* Example:
* obj.filters.push(new fabric.Image.filters.StackBlur(6));
* obj.applyFilters(canvas.renderAll.bind(canvas));
*
* Heavily inspired by:
* https://gist.github.com/pierrickouw/2ab679159beee9d80ca6
* http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html
* uses stackBlurCanvasRGBA function but could be swapped be stackBlurCanvasRGB
@pqina
pqina / create-thumbnail.php
Last active January 4, 2025 17:42
Create thumbnails with PHP
<?
// Link image type to correct image loader and saver
// - makes it easier to add additional types later on
// - makes the function easier to read
const IMAGE_HANDLERS = [
IMAGETYPE_JPEG => [
'load' => 'imagecreatefromjpeg',
'save' => 'imagejpeg',
'quality' => 100