Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
from tkinter import filedialog
from tkinter import *
from tkinter import messagebox
from PIL import Image, ImageTk
from subprocess import Popen, PIPE
import scipy
import cv2
# import matplotlib.pyplot as plt
from matplotlib import cm
@samparsky
samparsky / SafeTransfer.sol
Last active June 20, 2019 09:31
SafeERC20 token transfer
pragma solidity ^0.5.2;
interface BadToken {
function transfer(address to, uint value) external;
function transferFrom(address from, address to, uint value) external;
}
contract SafeTransfer {
function safeTransfer(address token, address to, uint value, bool from) internal returns (bool result) {
if (from) {
@samparsky
samparsky / EIP712.json
Last active October 20, 2019 13:40
EIP712
{"types":{"domineering":[{"name":"smoggy","type":"smoggy"}],"smoggy":[{"name":"visitor","type":"visitor"}],"visitor":[{"name":"wretched","type":"wretched"}],"wretched":[{"name":"glue","type":"glue"}],"glue":[{"name":"calendar","type":"calendar"}],"calendar":[{"name":"lumber","type":"lumber"}],"lumber":[{"name":"plant","type":"plant"}],"plant":[{"name":"giraffe","type":"giraffe"}],"hilarious":[{"name":"trite","type":"trite"}],"trite":[{"name":"stitch","type":"stitch"}],"stitch":[{"name":"gun","type":"gun"}],"stranger":[{"name":"fumbling","type":"fumbling"}],"fumbling":[{"name":"tasteless","type":"tasteless"}],"tasteless":[{"name":"strap","type":"strap"}],"strap":[{"name":"combative","type":"combative"}],"combative":[{"name":"nod","type":"nod"}],"nod":[{"name":"moor","type":"moor"}],"moor":[{"name":"label","type":"label"}],"label":[{"name":"book","type":"book"}],"book":[{"name":"lucky","type":"lucky"}],"shiny":[{"name":"cows","type":"cows"}],"cows":[{"name":"crazy","type":"crazy"}],"crazy":[{"name":"box","type"
@samparsky
samparsky / AdexQuery.json
Last active February 11, 2020 07:06
EventAggregate with Channel lookup
[
{
"$lookup":{
"from":"channels",
"localField":"channelId",
"foreignField":"id",
"as":"channel"
}
},
{
@samparsky
samparsky / bip84.go
Last active July 17, 2020 19:10
Bitcoin Bip84 Address Generation Golang
package main
import (
"fmt"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil"
)
@samparsky
samparsky / default.md
Created June 24, 2025 09:17 — forked from cablej/default.md
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.