Skip to content

Instantly share code, notes, and snippets.

View cbess's full-sized avatar
💭
Coding for Jesus' glory. Soli Deo gloria

C. Bess cbess

💭
Coding for Jesus' glory. Soli Deo gloria
View GitHub Profile
@cbess
cbess / mysql-sp.md
Last active September 23, 2022 18:47
mysql stored procedure call from golang

A stored procedure that saves (insert/update) a URL, then returns the id for the record.

Works in Go v1.11.6+ and MySQL 5.7+.

DELIMITER ;;

CREATE DEFINER=`root`@`%` PROCEDURE SaveUrl(
    IN p_url varchar(8200),
    IN p_title text
@cbess
cbess / provision.py
Created June 14, 2021 17:45
python-digitalocean server provisioning Py3 module
# the server provisioning module
# uses: python-digitalocean==1.16.0
# ref: https://developers.digitalocean.com/documentation/v2/#droplets
import digitalocean
import os
class ProvisionServerException(Exception):
pass
@cbess
cbess / s3_uploader.go
Created June 16, 2021 01:36
golang S3 upload module with gzip file compression
package uploader
import (
"bytes"
"compress/gzip"
"myapp/internal/config"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
@cbess
cbess / empty.theme.html
Last active September 23, 2024 13:17
Empty Blogger Theme HTML
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<meta charset='utf-8' />
<meta content='IE=edge' http-equiv='X-UA-Compatible' />
<meta content='width=device-width, initial-scale=1' name='viewport' />
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta content='C. Bess - perfectGod.com' name='author' />