Skip to content

Instantly share code, notes, and snippets.

View howardpen9's full-sized avatar
💭
I may be slow to respond.

Howard Peng howardpen9

💭
I may be slow to respond.
View GitHub Profile
@TrueCarry
TrueCarry / check.ts
Last active April 17, 2024 21:08
TON Connect V2 Proof verification
async function check(req, res) {
const walletInfo = req.body.walletInfo as Wallet
if (!walletInfo?.connectItems?.tonProof) {
return res.status(httpStatus.BAD_REQUEST).send({ ok: false })
}
const proof = walletInfo.connectItems.tonProof as TonProofItemReplySuccess
if (!proof) {
return res.status(httpStatus.BAD_REQUEST).send({ ok: false })
}
// I had been intending for people to just play around with this for fun and for personal use,
// but I've been advised to remove the first portion due to regulatory uncertainty.
// This way people can still use the merge check however they want.
/** @notice Determine whether we're running in Proof of Work or Proof of Stake
@dev Post-merge, the DIFFICULTY opcode gets renamed to PREVRANDAO,
and stores the prevRandao field from the beacon chain state if EIP-4399 is finalized.
If not the difficulty must be be 0 according to EIP-3675, so both possibilities are checked here. */
function haveWeMergedYet() public view returns (bool) {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rtt
rtt / tinder-api-documentation.md
Last active April 20, 2024 17:01
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

// Frees the `[].slice` method to accept `this` as the first actual argument,
// rather than a special argument.
var toArray = Function.call.bind([].slice)
// To make searching efficient (O(1)), we switch the
// list of things to a HashMap, which allows we to
// retrieve an item by its name in constant time.
function indexBy(field, list) {
return list.reduce(function(result, item) {
result[item[field]] = item