Skip to content

Instantly share code, notes, and snippets.

pragma solidity 0.5.17;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
import "@openzeppelin/contracts/ownership/Ownable.sol";
import './interfaces/IUniswapV2Router01.sol';
contract IERC20Burnable is IERC20 {
pragma solidity ^0.7.0;
contract EOAProxy {
address implementation = DEFAULT_IMPL_ADDR;
function _eoaUpgrade(address _newImplementation) external {
require(msg.sender == address(this));
implementation = _newImplementation;
}
fallback() external {
address impl = implementation;
@nhancv
nhancv / TRONTokenClient.ts
Created January 21, 2020 04:36
TRC10 Token
import TronWeb from 'tronweb'
export default class TRONTokenClient {
async start(): Promise<any> {
const mainNetProvider = 'https://api.trongrid.io';
const testNetProvider = 'https://api.shasta.trongrid.io';
const netProvider = testNetProvider;
const HttpProvider = TronWeb.providers.HttpProvider; // Optional provider, can just use a url for the nodes instead
const fullNode = new HttpProvider(`${netProvider}`); // Full node http endpoint
@boeledi
boeledi / OverlayableContainerOnLongPress_sample.dart
Last active February 9, 2025 21:30
How to display an overlay on top of a particular item, present in a Scroll Area, on longPress?
import 'package:flutter/material.dart';
import 'dart:math';
void main() {
///
/// Launch the application
///
runApp(const Application());
}
@netsmertia
netsmertia / main.dart
Created May 4, 2018 13:53
flutter image drawing in canvas
import 'package:flutter/material.dart';
import 'dart:ui' as ui;
import 'package:flutter/services.dart' show rootBundle;
import 'dart:async';
import 'dart:typed_data';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@rivo
rivo / serve.go
Created November 26, 2017 12:28
Graceful stop and restart for HTTP servers in Go
package main
import (
"context"
"fmt"
"net"
"net/http"
"os"
"os/exec"
"os/signal"
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active September 15, 2025 01:45
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@littlecodersh
littlecodersh / main.py
Last active April 28, 2025 05:39
Main script behind itchat robot
#coding=utf8
import itchat
# tuling plugin can be get here:
# https://github.com/littlecodersh/EasierLife/tree/master/Plugins/Tuling
from tuling import get_response
@itchat.msg_register('Text')
def text_reply(msg):
if u'作者' in msg['Text'] or u'主人' in msg['Text']:
return u'你可以在这里了解他:https://github.com/littlecodersh'
@guileen
guileen / p2pclient.go
Last active September 3, 2019 07:31
Go P2P Demo
// golang p2p udp client
package main
import (
"fmt"
"net"
"log"
"encoding/binary"
"encoding/hex"
/**
* 百度统计订单跟踪
*
* 注意事项:
* 1. 页面需要安装百度统计的异步js代码,建议安装在页面顶部 </head> 标签之前,详情请参考获取代码页面的帮助信息。
* 2. 调用订单跟踪接口的位置,要在百度统计异步js代码的后面,至少要在 var _hmt = _hmt || []; 语句之后。
* 3. 所有字段名必须与示例中给出的名称保持字母和大小写完全一致。
*/
// 接口格式。