This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.3/contracts/security/ReentrancyGuard.sol"; | |
contract Attackee is ReentrancyGuard { | |
mapping(address => uint) public attackeeBalances; | |
function depositIntoAttackee() external payable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var blobUrl = URL.createObjectURL(blob); | |
var link = document.createElement("a"); // Or maybe get it from the current document | |
link.href = blobUrl; | |
link.download = "image.jpg"; | |
// link.innerText = "Click here to download the file"; | |
document.body.appendChild(link); // Or append it whereever you want | |
link.click(); | |
link.remove(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta name="mobile-web-app-capable" content="yes" /> | |
<meta name="apple-touch-fullscreen" content="yes" /> | |
<meta name="apple-mobile-web-app-title" content="Expo" /> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="default" /> | |
<link | |
rel="apple-touch-icon" | |
sizes="180x180" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"txn": async function(req) { | |
return new Promise(async function(resolve, reject) { | |
var frame = {}; | |
frame.id = req.params.id; | |
frame.square = true; | |
frame.postUrl = `https://frm.lol/frames/${req.params.id}`; | |
const frameResult = await util.validate(req); // neynar frame validation endpoint | |
if (frameResult.valid == true) { | |
if ("transactionId" in req.body.untrustedData) { | |
// transaction has completed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
push: | |
branches: | |
- main | |
- master | |
pull_request: | |
branches: | |
- main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const file = document.querySelector("input[type=file]").files[0]; | |
const reader = new FileReader(); | |
reader.readAsArrayBuffer(file); | |
reader.onload = () => { | |
const key = require("../arweave-keyfile.json"); | |
const arweave = Arweave.init({ | |
host: "arweave.net", | |
port: 443, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Constants { | |
/** | |
* Contains the path to your Lambda function code. | |
*/ | |
public static final String LAMBDA_TASK_ROOT = System.getenv("LAMBDA_TASK_ROOT"); | |
/** | |
* The environment variable is set to one of the following options, depending on the runtime of the Lambda function: | |
* AWS_Lambda_nodejs, AWS_Lambda_nodejs4.3, AWS_Lambda_nodejs6.10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var readline = require('readline'), | |
rl = readline.createInterface(process.stdin, process.stdout); | |
rl.setPrompt('OHAI> '); | |
rl.prompt(); | |
rl.on('line', function(line) { | |
switch(line.trim()) { | |
case 'exit': | |
rl.close(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fbb7daec1be993d3a4cd6f6181f332a0 | |
use std::future::Future; | |
use std::pin::Pin; | |
use std::thread; | |
use futures::future::{pending, poll_fn}; | |
use lazy_static::lazy_static; | |
use tokio::runtime::{Handle, Runtime}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const buffer = require('buffer'); | |
const crypto = require('crypto'); | |
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib. | |
const aes256gcm = (key) => { | |
const ALGO = 'aes-256-gcm'; | |
// encrypt returns base64-encoded ciphertext | |
const encrypt = (str) => { | |
// Hint: the `iv` should be unique (but not necessarily random). |
NewerOlder