Skip to content

Instantly share code, notes, and snippets.

View eduncan911's full-sized avatar

Eric Duncan eduncan911

View GitHub Profile
@eduncan911
eduncan911 / go-build-all
Last active December 25, 2023 16:54
Go Cross-Compile Script
#!/bin/bash
#
# GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go
#
# To use:
#
# $ cd ~/path-to/my-awesome-project
# $ go-build-all
#
https://youtu.be/-C-JoyNuQJs?t=39m45s
When I put the reference implementation onto the website I needed to
put a software license on it.
And I looked at all the licenses that were available, and there were a lot
of them. And I decided that the one I liked the best was the MIT License,
which was a notice that you would put on your source and it would say,
"you're allowed to use this for any purpose you want, just leave the
notice in the source and don't sue me."
@eduncan911
eduncan911 / Revert-Gist.md
Last active July 20, 2023 09:41
Revert Gist Commits

Revert / Undo a Gist Commit

It was not exactly obvious. Here's how to revert a Gist commit!

Checkout the gist like a normal git repo:

# replace the Gist ID with your own
git clone git@github.com:cc13e0fcf2c348cc126f918e4a3917eb.git

Treat it like a normal repo. Edit, force push, etc.

@eduncan911
eduncan911 / README.md
Last active July 10, 2023 21:12
Fixing Thermal Throttling on Thinkpad P1 and X1 Extreme - Linux Edition

Fixing Thermal Throttling on Thinkpad P1 and X1 Extreme - Linux Edition

Lenovo messed up with the X1E and P1 Gen 1 versions (and maybe later generations) in that the system boots with a thermal limit (aka Tjunction or tjmax) set to 82C (some report 80C). What this means is that regardless of power draw or under-volting settings, when your CPU hits 82C, it will drop the frequency down to the "Configurable TDP-down" frequency, or even lower. It will also may limits the system power draw.

Thermal Paste and Stress Testing

@eduncan911
eduncan911 / plex.sh
Last active July 6, 2023 20:06
Plex + Docker + Updated Chromecast Ultra Config
#!/usr/bin/env bash
#
# Plex's profile for Chromecast is too conservative and only plays 1080p on
# the Chromecast Ultra UHD device (4k).
#
# This script will download an updated Chromecast definition and start a Plex
# docker container, binding a few local paths of where you run this script.
#
# You may want to refer to the Official Plex Docker repository and read the
# README text: https://github.com/plexinc/pms-docker
@eduncan911
eduncan911 / Octopress\blogml.rb
Last active September 22, 2022 23:51
Octopress (and Jekyll) BlogML importer. See revision history for my changes.
# BlogML import script originally sourced from:
# https://github.com/philippkueng/philippkueng.github.com/tree/30ef1570f06d33938b18d5eee7767d6641b9a779/source/_import
# Best post I could find about how to use it was here:
# http://philippkueng.ch/migrate-from-blogengine-dot-net-to-jekyll.html
#
# how to install
# --------------
# mkdir source/_importer
# cp blogml.rb to the source/_importer/ you created above
# cp your BlogML.xml to the same source/_importer/ directory
@eduncan911
eduncan911 / main.go
Created June 9, 2016 19:56
Labels in GoLang
package main
import "fmt"
/*
Here's a use of labels in Go to continue a for loop
from within another for and within a switch case.
*/
func main() {
@eduncan911
eduncan911 / main.go
Created July 27, 2014 00:27
Go/Reading Console Inputs
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func main() {

This is my response to an email asking about Domain-Driven Design in golang project.

Thank you for getting in touch. Below you will find my thoughts on how golang works with DDD, changing it. This is merely a perception of how things worked out for us in a single project.

That project has a relatively well-known domain. My colleagues on this project are very knowledgeable, thoughtful and invested in quality design. The story spelled out below is a result of countless hours spent discussing and refining the approach.

Conclusions could be very different, if there was a different project, team or a story-teller.

Short story

@eduncan911
eduncan911 / gnome-install-extensions
Last active July 25, 2019 22:43
Gnome: Manually add several Extensions (or, for those that don't trust browser extensions)
#!/bin/bash -e
# A script to mass install Gnome extensions from a single folder.
#
# for global extensions, use /usr/share/gnome-shell/extensions/
EXTENSIONS_DIR=~/.local/share/gnome-shell/extensions
TMP_DIR="/tmp/gnome-install-extensions"
DIR=$1