Skip to content

Instantly share code, notes, and snippets.

@gorgos
gorgos / MultiSwap.sol
Created August 22, 2021 11:04
Example for how to swap multiple tokens in one on Ropsten
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/ISwapRouter.sol";
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/IQuoter.sol";
import {IERC20, SafeERC20} from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4-solc-0.7/contracts/token/ERC20/SafeERC20.sol";
interface IUniswapRouter is ISwapRouter {
@yxztj
yxztj / TaskConcurrencyManifesto.md
Last active March 1, 2024 07:01 — forked from lattner/TaskConcurrencyManifesto.md
Swift Concurrency Manifesto 中文翻译
@ifels
ifels / golang_nginx.txt
Last active November 20, 2020 03:59
通过nginx反向代理go语言写的http服务器
通过nginx反向代理go语言写的http服务器
1. nginx 配置
#列出所有服务器地址,nginx 自动均衡分发请求到各个服务器。
upstream frontends {
ip_hash;
server 192.168.199.1:8088;
server 192.168.199.2:8089;
}
server {
listen 80;
@adion
adion / Gruntfile.js
Last active February 16, 2019 12:12
Example Gruntfile for grunt-contrib-watch with livereload.
'use strict';
var
LIVERELOAD_PORT = 35729,
lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT }),
mountFolder = function( connect, dir ) {
return connect.static(require('path').resolve(dir));
};
module.exports = function( grunt ) {
@angelolloqui
angelolloqui / UIImage+H568.m
Last active October 6, 2022 16:35
iPhone5 UIImage method swizzling to load -568h images
//
// UIImage+H568.m
//
// Created by Angel Garcia on 9/28/12.
// Copyright (c) 2012 angelolloqui.com. All rights reserved.
//
#import <objc/runtime.h>
@implementation UIImage (H568)
@872409
872409 / GoogleReader.py
Created September 13, 2012 02:51
GoogleReader 订阅XX天无更新退订管理
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@author: dawn
'''
import urllib, urllib2, cookielib, json
from datetime import datetime
EMAIL = 'xxx@gmail.com'
@mrluanma
mrluanma / requirements.txt
Created September 4, 2012 14:40
Python 登录新浪微博(requests 真的比 urllib2 强了 2^^32 倍 pip install requests)
requests==2.4.3
rsa==3.1.4
@872409
872409 / gist:3384075
Created August 18, 2012 03:03 — forked from lucifr/gist:1208100
Sublime Text 2 - 实用快捷键 (Mac OS X)
@872409
872409 / wawaevent.js
Created May 9, 2012 15:51 — forked from onlytiancai/wawaevent.js
异步任务流管理器
/* module name: wawaevent
* version: 0.1
* depend:underscore,backbone
* description: 处理javascript的异步任务流
* document:
* setup:指定任务流逻辑
* 1. 可以用sequence来设置一个列表来制定, 如{'sequence': ['worker1', 'worker2', 'worker3']}
* 1. 可以用逗号隔开多个eventName,然后制定一个handler,如{'worker1.error, worker2.error': 'default_error_handler'}
* 1. 可以单独指定一个事件的handler,handler除了可以使用任务流名字外
* ,还可以直接使用函数,如{'worker1': function(){console.log('worker1 success')}}
@abtris
abtris / Php.sublime-build
Last active October 26, 2022 12:56
Sublime Text 3 - run php script at F7
{
"cmd": ["php", "$file"],
"selector": "source.php",
"target": "exec",
"variants": [
{ "cmd": ["/usr/local/php5/bin/phpunit", "$file"],
"name": "Run"
}
]
}