Skip to content

Instantly share code, notes, and snippets.

View crazygit's full-sized avatar

Crazygit crazygit

View GitHub Profile
@arshamalh
arshamalh / erc20_balance.go
Last active February 17, 2024 07:30
Finding ETH erc20 tokens balance using golang and infura.io
/// Import on the top of your project
import "github.com/ethereum/go-ethereum/crypto"
type ethHandlerResult struct {
Result string `json:"result"`
Error struct {
Code int64 `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
@singledigit
singledigit / cognito.yaml
Last active January 16, 2024 16:15
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@ngse
ngse / audit_mixin.py
Last active May 21, 2023 13:56
Rough attempt at implementing an audit log against Flask/Flask Login/SQLAlchemy models
# Requires use of Flask Login for the user tracking
# Implement by using AuditableMixin in your model class declarations
# e.g. class ImportantThing(AuditableMixin, Base):
import json
from flask_login import current_user
from sqlalchemy import event, inspect
from sqlalchemy.orm import class_mapper
from sqlalchemy.orm.attributes import get_history
@BretFisher
BretFisher / docker-for-mac.md
Last active April 25, 2024 15:59
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@gene1wood
gene1wood / role_arn_to_session.py
Created December 29, 2016 17:38
Simple python function to assume an AWS IAM Role from a role ARN and return a boto3 session object
import boto3
def role_arn_to_session(**args):
"""
Usage :
session = role_arn_to_session(
RoleArn='arn:aws:iam::012345678901:role/example-role',
RoleSessionName='ExampleSessionName')
client = session.client('sqs')
"""
@lukas-h
lukas-h / license-badges.md
Last active April 21, 2024 09:35
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@ElijahLynn
ElijahLynn / pipe_to_docker_examples
Last active March 13, 2024 03:29
How to pipe to `docker exec` examples
# These examples assume you have a container currently running.
# 1 Pipe from a file
sudo docker exec --interactive CONTAINER_NAME /bin/bash < the_beginning.sh | tee the_beginning_output.txt`
#2a Pipe by piping
echo "echo This is how we pipe to docker exec" | sudo docker exec --interactive CONTAINER_NAME /bin/bash -
@ahmozkya
ahmozkya / README.md
Last active July 7, 2023 09:27
Homebrew with DNSMasq + DNSCrypt-proxy (OpenDNS)
@rxaviers
rxaviers / gist:7360908
Last active April 25, 2024 23:16
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@maxcnunes
maxcnunes / .gitignore
Created September 25, 2013 20:03
Git keep empty folder: 1. Add a .gitkeep file inside the folder you want to keep 2. Then include this configuration in your .gitignore
path_your_folder/*
!path_your_folder/.gitkeep