Skip to content

Instantly share code, notes, and snippets.

Avatar

rowan rowanu

View GitHub Profile
@Linch1
Linch1 / tokenPriceApi.js
Last active May 12, 2022
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
View tokenPriceApi.js
let pancakeSwapAbi = [{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"interna
@iann0036
iann0036 / gist:b473bbb3097c5f4c656ed3d07b4d2222
Last active May 9, 2022
List of expensive / long-term effect AWS IAM actions
View gist:b473bbb3097c5f4c656ed3d07b4d2222
route53domains:RegisterDomain
route53domains:RenewDomain
route53domains:TransferDomain
ec2:ModifyReservedInstances
ec2:PurchaseHostReservation
ec2:PurchaseReservedInstancesOffering
ec2:PurchaseScheduledInstances
rds:PurchaseReservedDBInstancesOffering
dynamodb:PurchaseReservedCapacityOfferings
s3:PutObjectRetention
View aws-unsubscribe-email.sh
#!/bin/bash
# This is a script that unsubscribes an email address from AWS junk mail.
# If the script breaks it might be the magic numbers that needs to change.
# Send the form while tracing the request in your browser to find the new values.
# https://pages.awscloud.com/communication-preferences
unsubscribe_aws_email() {
curl "https://pages.awscloud.com/index.php/leadCapture/save2" \
-H "Accept: application/json" \
@buggy
buggy / index.ts
Created Dec 3, 2019
Generate SAM Project Using Amplify Transformers
View index.ts
import * as fs from "fs";
import * as yaml from "js-yaml";
import GraphQLTransform from "graphql-transformer-core";
import DynamoDBModelTransformer from "graphql-dynamodb-transformer";
import ModelAuthTransformer from "graphql-auth-transformer";
import ModelConnectionTransformer from "graphql-connection-transformer";
import SearchableModelTransformer from "graphql-elasticsearch-transformer";
import VersionedModelTransformer from "graphql-versioned-transformer";
import FunctionTransformer from "graphql-function-transformer";
@wolfeidau
wolfeidau / cognito.yml
Last active Jan 28, 2020
Cognito CFN stack with domain verification
View cognito.yml
AWSTemplateFormatVersion: 2010-09-09
Description: 'authentication: Resources for hosting authentication using AWS Cognito, a @wolfeidau template'
Parameters:
AppName:
Description: Name of application, used in signup emails and naming of aws resources.
Type: String
AllowedPattern: '^[a-zA-Z0-9]*$'
@wolfeidau
wolfeidau / sam.md
Created May 9, 2018
Install sam from scratch on osx with homebrew.
View sam.md

To setup sam local on an OSX system which is using homebrew.

Check if pip installed.

pip --version

If this returns.

@stevenringo
stevenringo / reinvent-2017-youtube.md
Created Dec 3, 2017
Links to YouTube recordings of AWS re:Invent 2017 sessions
View reinvent-2017-youtube.md

| Title | Description

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 24, 2022
Falsehoods programmers believe about time, in a single list
View falsehoods-programming-time-list.md

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@mojodna
mojodna / 0_register_planet.sql
Last active May 18, 2022
Sample OSM Athena queries
View 0_register_planet.sql
--
-- This will register the "planet" table within your AWS account
--
CREATE EXTERNAL TABLE planet (
id BIGINT,
type STRING,
tags MAP<STRING,STRING>,
lat DECIMAL(9,7),
lon DECIMAL(10,7),
nds ARRAY<STRUCT<ref: BIGINT>>,