Skip to content

Instantly share code, notes, and snippets.

View RobertWHurst's full-sized avatar
Magic crafting

Robert Hurst RobertWHurst

Magic crafting
  • Vancouver, BC, Canada
  • 06:04 (UTC -07:00)
View GitHub Profile

🚀 TelemetryX Go Services Style Guide

⏱️ Read time: ~25 minutes | Grab a cup of tea or coffee and settle in for some coding wisdom!

This guide defines the essential coding standards, architectural patterns, and engineering practices for all Go services at TelemetryX. By following these standards, you'll build services that are maintainable, scalable, and consistent with our ecosystem.

Why this matters: Consistent code is easier to understand, review, test, and maintain. These standards have evolved from our team's experience and represent our collective best practices. Whether you're building a new service or enhancing an existing one, this guide will help you create high-quality code that aligns with our engineering culture.

📚 Table of Contents

@RobertWHurst
RobertWHurst / index.js
Created June 20, 2020 00:14
Convert ttf fonts to woff and woff2
const ttf2woff = require('ttf2woff')
const ttf2woff2 = require('ttf2woff')
const fs = require('fs')
const path = require('path')
const dir = fs.readdirSync('./')
for (const file of dir) {
const ext = path.extname(file)
if (ext !== '.woff' && ext !== '.woff2') {
@RobertWHurst
RobertWHurst / recover-files.js
Created December 3, 2015 09:46
Recover files by extension from a directory
var fs = require('fs');
var path = require('path');
var mkdirp = require('mkdirp');
var rimraf = require('rimraf');
var through = require('through2');
var SOURCE_PATH = '/media/roberthurst/CE543276543260FF';
var DEST_PATH = '/media/roberthurst/478FC40638130E7A/recovered-files';
var MANIFEST_FILE = '/media/roberthurst/478FC40638130E7A/recovered-files.txt';
@RobertWHurst
RobertWHurst / mongoose-soft-remove.js
Created August 14, 2015 09:15
Mongoose Soft Remove Plugin
var Model = require('mongoose').Model;
function softRemove(schema) {
if (!schema.path('isRemoved')) {
schema.add({ isRemoved : { type: Boolean, index: true, default: false } });
}
if (!schema.path('removedAt')) {
@RobertWHurst
RobertWHurst / less2styl.js
Created June 1, 2013 13:35
Convert less to stylus files. Note that less scoping will not work in stylus as stylus does not have scoping.
var fs = require('fs');
function less2stylus(source, mixinNames) {
return source
// @var => $var
.replace(/@([a-zA-Z0-9-_]+)[\s\t]*(:?)[\s\t]*/g, function(str, key, sep) {
// do not convert import or media keywords
if(['import', 'media'].indexOf(key) > -1) { return str; }
@RobertWHurst
RobertWHurst / cookie.js
Created December 18, 2012 20:24
A simple function for getting and setting cookies. If false is set as a cookie's value, the cookie will be deleted.
(function(factory) {
if(typeof define === 'function' && define.amd) {
define(factory);
} else {
window.SpringJS = factory();
window.s = window.SpringJS;
}
})(function() {