Skip to content

Instantly share code, notes, and snippets.

@adietrichs
adietrichs / EIP3074Relayer.sol
Last active April 24, 2024 10:33
EIP-3074 Invoker Examples
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
interface WETH9 {
function balanceOf(address) external returns (uint256);
function deposit() external payable;
function withdraw(uint256) external;

Comparison of ASP.NET and Node.js for Backend Programming

We will compare ASP.NET and Node.js for backend programming.
Source codes from examples.

Updates

This document was published on 21.09.2015 for a freelance employer. Some changes since then (14.02.2016):

  1. Koa.js no longer uses co-routines, it has switched to Babel's async/await. yield and await are used almost in the same way, so I see no point to rewrite the examples.
@dfjlh
dfjlh / networking.md
Created April 24, 2024 10:31 — forked from michaellihs/networking.md
Networking Cheatsheet

Networking Cheat Sheet

Sniff Network Traffic from / to IP

tcpdump -n -i eth0 src SRC_IP  or dst DEST_IP

Create Routes

@dreness
dreness / add_fork_remote.sh
Last active April 24, 2024 10:31
Use gh cli and fzf to add a remote for a fork of the current repo
#!/bin/sh
# Scenario:
# - you have a local checkout of a github repo
# - you're looking at public forks of that repo
# - you want to add a remote to your local checkout for one of the forks
set -e
set PIPEFAIL
@rxaviers
rxaviers / gist:7360908
Last active April 24, 2024 10:27
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@syrte
syrte / arcs.py
Last active April 24, 2024 10:27
Plot a collection of patches (circles, ellipses, rectangles), similar to `plt.scatter` but the size of patches are in data unit.
from __future__ import division, print_function, absolute_import
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Arc
from matplotlib.collections import PatchCollection
__all__ = ['arcs']
def arcs(x, y, w, h=None, rot=0.0, theta1=0.0, theta2=360.0,
c='b', vmin=None, vmax=None, **kwargs):
@Esonhugh
Esonhugh / aws_auto_assume.sh
Created April 24, 2024 10:05
automatically assume role with aws cli
# automatically set the AWS environment variables from the json output of `aws sts assume-role`
aws_sts_env () {
if [[ -z "$1" ]]
then
echo "Usage: $0 \`json\`"
echo "Example: export cred=\`aws sts assume-role --role-arn xxxx --role-session-name xxxx|jq ".Credentials"\`"
echo " aws_sts_env \$cred"
return
fi
export AWS_ACCESS_KEY_ID=`echo $1|jq -r '.AccessKeyId' `
@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active April 24, 2024 10:24
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@bszwej
bszwej / echo.js
Last active April 24, 2024 10:23
Pure Node.js echo server, that logs all incoming http requests (method, path, headers, body).
const http = require('http');
const server = http.createServer();
server.on('request', (request, response) => {
let body = [];
request.on('data', (chunk) => {
body.push(chunk);
}).on('end', () => {
body = Buffer.concat(body).toString();
@harlow
harlow / golang_job_queue.md
Last active April 24, 2024 10:21
Job queues in Golang