Skip to content

Instantly share code, notes, and snippets.

View MaG21's full-sized avatar
💭
Statically typed languages and VIM

MaG21

💭
Statically typed languages and VIM
View GitHub Profile
@andelf
andelf / trc20.py
Created February 28, 2020 18:14
Get TRC20 balance and Transfer TRC20 tokens
import requests
import base58
import base64
from pprint import pprint
ADDRESS = "T....your address"
PRIV_KEY = 'hex private key'
CONTRACT = "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" # USDT
@Hakky54
Hakky54 / openssl_commands.md
Last active November 12, 2024 05:41 — forked from p3t3r67x0/openssl_commands.md
OpenSSL Cheat Sheet - Some list of openssl commands for check and verify your keys

OpenSSL Cheat Sheet 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@djg07
djg07 / ASL
Created September 14, 2019 01:46
{
"Comment": "A simple AWS Step Functions state machine that automates a call center support session.",
"StartAt": "ProcessTransaction",
"States": {
"ProcessTransaction": {
"Type" : "Choice",
"Choices": [
{
"Variable": "$.TransactionType",
"StringEquals": "PURCHASE",
@anachronic
anachronic / jwtest.py
Created March 5, 2019 03:44
JWT creation and verification using python-jose
from jose import jwt
from jose.jwt import JWTClaimsError, JWTError, ExpiredSignatureError
from datetime import datetime, timedelta
import time
key = 'secret#%$sdfasdkflj@#%RFsaior82340-fweASDFSD928354940k'
expdelta = timedelta(seconds=10)
now = datetime.utcnow()
exp = now + expdelta
@kuzminT
kuzminT / about_wordpress.md
Last active December 21, 2019 07:11
Wordpress tips for custom theme creating
@shaselton
shaselton / vpc.tf
Last active August 8, 2021 04:26
VPC template
# Rough Implementation of the pattern found here: https://medium.com/aws-activate-startup-blog/practical-vpc-design-8412e1a18dcc
provider "aws" {
region = "us-east-1"
}
# create a vpc
resource "aws_vpc" "shaselton" {
cidr_block = "10.0.0.0/16"
enable_dns_hostnames = true
@MaciejGad
MaciejGad / NSImageExtensions.swift
Created March 24, 2017 11:49
NSImage extensions for easy resizing, cropping and saving png images. Version updated for Swift 3. Originally by Raphael Hanneken https://gist.github.com/raphaelhanneken/cb924aa280f4b9dbb480
extension NSImage {
/// Returns the height of the current image.
var height: CGFloat {
return self.size.height
}
/// Returns the width of the current image.
var width: CGFloat {
return self.size.width
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@tameemsafi
tameemsafi / emails.php
Last active July 29, 2024 21:04
Send an email programmatically in wordpress with wp_mail using the woocommerce transaction emails template.
<?php
// Define a constant to use with html emails
define("HTML_EMAIL_HEADERS", array('Content-Type: text/html; charset=UTF-8'));
// @email - Email address of the reciever
// @subject - Subject of the email
// @heading - Heading to place inside of the woocommerce template
// @message - Body content (can be HTML)
function send_email_woocommerce_style($email, $subject, $heading, $message) {
@cmoulton
cmoulton / Custom HTTP Headers with Swift and Alamofire.swift
Last active July 15, 2022 12:37
Custom HTTP Headers with Swift 3 or 4 and Alamofire 4.0-4.7: See https://grokswift.com/custom-headers-alamofire4-swift3/ for explanations
// MARK: - Adding a header to a single request
func doRequestWithHeaders1() {
let headers: HTTPHeaders = [
"X-Mashape-Key": MY_API_KEY,
"Accept": "application/json"
]
Alamofire.request("https://mashape-community-urban-dictionary.p.mashape.com/define?term=smh", headers: headers)
.responseJSON { response in
debugPrint(response)