Skip to content

Instantly share code, notes, and snippets.

@APTy
APTy / LICENSE
Created January 18, 2022 16:07
Signing and Verifying Eth Sign Typed Data (eth_signTypedData_v4)
MIT License
Copyright 2022 APTy
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
@APTy
APTy / README.md
Last active November 20, 2017 15:44
base64-json-decoder

base64-json-decoder

Quickstart

Install

pip install -e git+https://gist.github.com/APTy/8dea3010c0b261689339a8cc52e8dc76#egg=base64-json-decoder
@APTy
APTy / Makefile
Last active October 12, 2020 16:01
Run a makefile command with cleanup
# This file includes example usage and tests for the 'run-with-cleanup' call-able function.
.PHONY: test test-success test-failure main cleanup
-include cleanup.mk
test:
test.sh
main:
@APTy
APTy / README.md
Last active April 6, 2017 16:29
urldump

urldump

This is a hexdump-style stream processing tool to convert from readable, UTF8-encoded text into URL-encoded output.

Install

sudo npm -g install git+https://gist.github.com/bc62904c1956837a01d49d11767f8102.git
@APTy
APTy / file.go
Created February 7, 2017 23:24
cgo
// A simple cgo example for writing to a file.
package main
// #include <stdlib.h>
// #include <stdio.h>
import "C"
import (
"errors"
"fmt"
@APTy
APTy / README.md
Last active January 10, 2017 01:07
greetme

greetme

The greetme tool will greet any user! This project is an example of how to install a python script from a GitHub Gist.

Installation

You can install this project using pip and run it as follows:

sudo pip install -e git+https://gist.github.com/APTy/29f22f28471b37ba00fa032859cb6ab9#egg=greetme
import smtplib
import email.mime.text as text
TARGETS = ['me@example.com',]
def notify(targets, subject, message):
server = smtplib.SMTP('smtp.gmail.com:587')
server.ehlo()
server.starttls()
@APTy
APTy / multisig.py
Created January 30, 2016 01:46
two1 multisig
import two1.lib.bitcoin as bitcoin
from two1.lib.wallet import Wallet
wallet = Wallet()
# Collect public keys
p1_pubkey = wallet.get_payout_public_key()
p2_pubkey = wallet.get_change_public_key()
# Build multisig redeem script
@APTy
APTy / server.js
Created January 19, 2016 18:08
Image to get IP Address
var fs = require('fs');
var server = require('http').createServer();
var httpPng;
const HTTP_STATUS_OK = 200;
const PNG_FILE_NAME = 'http.png';
const PNG_HEADER = {'Content-Type': 'image/png'};
// Load the file into memory
fs.readFile(PNG_FILE_NAME, function(err, data) {