Skip to content

Instantly share code, notes, and snippets.

View andrewgcodes's full-sized avatar
🎯
Focusing

Andrew Kean Gao andrewgcodes

🎯
Focusing
View GitHub Profile
@andrewgcodes
andrewgcodes / contracts...prediction.sol
Created February 16, 2025 03:38
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
// USE AT OWN RISK, MADE FOR HACKATHON BY BEGINNER!!!!
pragma solidity ^0.8.0;
contract LocationBasedWildfirePredictionMarket {
uint256 public marketCounter;
struct Market {
uint256 id;
@andrewgcodes
andrewgcodes / contracts...eigensurance_1.sol
Created February 16, 2025 01:32
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
// USE AT OWN RISK, MADE FOR HACKATHON BY BEGINNER!!!!
pragma solidity ^0.8.0;
contract DisasterPropertyInsurance {
enum Tier { Bronze, Silver, Gold }
uint256 public constant POLICY_DURATION = 2 minutes;
uint256 public constant WAITING_PERIOD = 5 seconds;
uint256 public constant PREMIUM_INTERVAL = 30 seconds;
/**
* Configuration object for API settings.
* Contains key constants used throughout the extraction process.
*/
const API_CONFIG = {
key: "...", // Your Firecrawl API key
baseUrl: 'https://api.firecrawl.dev/v1', // Base URL for Firecrawl API endpoints
timeout: 30, // Timeout for HTTP requests in seconds
maxAttempts: 10, // Maximum number of attempts to poll for job completion
initialDelay: 1000 // Initial delay (in ms) before polling for job status
@andrewgcodes
andrewgcodes / pr-review.yml
Created January 19, 2025 05:41
Github Actions workflow using the Devin API for automatic PR reviews
name: Automated PR Review
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: read
issues: read
@andrewgcodes
andrewgcodes / gpt4o-tokens.txt
Created May 14, 2024 06:24
gpt4-o tokenizer tokens
This file has been truncated, but you can view the full file.
!
"
#
$
%
&
'
(
)
*
import SimpleITK as sitk
import numpy as np
import csv
import os
from PIL import Image
import matplotlib.pyplot as plt
def load_itk_image(filename):
itkimage = sitk.ReadImage(filename)
numpyImage = sitk.GetArrayFromImage(itkimage)