Skip to content

Instantly share code, notes, and snippets.

View crazygit's full-sized avatar

Crazygit crazygit

View GitHub Profile
@rxaviers
rxaviers / gist:7360908
Last active May 5, 2024 08:25
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:
@lukas-h
lukas-h / license-badges.md
Last active May 1, 2024 10:20
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)

@singledigit
singledigit / cognito.yaml
Last active April 28, 2024 15:12
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:
@BretFisher
BretFisher / docker-for-mac.md
Last active April 26, 2024 09:38
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


@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 -
@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"`
}
@ahmozkya
ahmozkya / README.md
Last active July 7, 2023 09:27
Homebrew with DNSMasq + DNSCrypt-proxy (OpenDNS)
@chuangbo
chuangbo / README.md
Last active June 19, 2023 04:48
Python dynamic DNSPod DNS Script

替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获取 API Token 的方式

获得 domain_id 可以用 curl

curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`
@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
@luhn
luhn / getter_and_setter.py
Created November 29, 2012 18:35
Using getters and setters with SQLAlchemy
class Table(Base):
id = Column(Integer, primary_key=True)
_name = Column('name', String(24))
@property
def name(self):
return self._name;
@name.setter
def name(self, value):