Skip to content

Instantly share code, notes, and snippets.

Coding for Jesus' glory. Soli Deo gloria

C. Bess cbess

Coding for Jesus' glory. Soli Deo gloria
Block or report user

Report or block cbess

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
cbess /
Last active Dec 27, 2019
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+.


    IN p_url varchar(8200),
    IN p_title text
cbess / DispatchQueueDelay.swift
Last active Sep 25, 2019
Swift DispatchQueue throttle and debounce class (thread-safe)
View DispatchQueueDelay.swift
// DispatchQueueDelay.swift
// Created by C. Bess on 9/17/19.
// MIT - Soli Deo gloria -
// refs:
// -
// -
cbess / .clang-format
Created Dec 9, 2018
My clang-format config file
View .clang-format
# use LLVM defaults
# BasedOnStyle: LLVM
# Soli Deo gloria
Language: ObjC
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
cbess / NSView+Screenshot.m
Last active Nov 22, 2018
NSWindow screenshot, best method found (objc)
View NSView+Screenshot.m
// ref:
@implementation NSView (Screenshot)
/// Returns an image that contains the entire window contents, including window background color and traffic lights.
/// Resembles the product of taking a screenshot using
- (NSImage *)screenshotOfWindow {
CGWindowID winID = (CGWindowID) self.window.windowNumber;
CGImageRef ref = CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, winID, kCGWindowImageBoundsIgnoreFraming);
return [[NSImage alloc] initWithCGImage:ref size:self.bounds.size];
cbess / example.js
Last active Jul 19, 2018
axios read pdf
View example.js
// ref:
const pdf = require('pdf-parse'); // v1.0.8
// ref:
const axios = require('axios'); // v0.18.0
const util = require('util');
const url = '';
// const url = '';
View genesis_public_key
cbess / TimeParts.swift
Last active Nov 14, 2019
Swift: Seconds to minutes and hours parts
View TimeParts.swift
/// Represents parts of time
struct TimeParts: CustomStringConvertible {
var seconds = 0
var minutes = 0
/// The string representation of the time parts (ex: 07:37)
var description: String {
return NSString(format: "%02d:%02d", minutes, seconds) as String
You can’t perform that action at this time.