Skip to content

Instantly share code, notes, and snippets.

View trentdavies's full-sized avatar
🎯
Focusing

Trent Davies trentdavies

🎯
Focusing
View GitHub Profile
@Blackshome
Blackshome / sensor-light.yaml
Last active March 17, 2026 03:11
Home Assistant Sensor Light that can be used in Blueprints
blueprint:
name: Sensor Light
description: >
# 💡 Sensor Light
**Version: 8.5**
Your lighting experience, your way - take control and customize it to perfection! 💡✨
@sts10
sts10 / rust-command-line-utilities.markdown
Last active March 14, 2026 17:33
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@treeder
treeder / Dockerfile
Last active August 30, 2018 03:24
triple stage docker builds
# 1) BUILD API
FROM golang:alpine AS build-go
RUN apk --no-cache add git bzr mercurial
ENV D=/go/src/github.com/USERNAME/REPONAME
# deps - using the closest thing to an official dependency tool: https://github.com/golang/dep
RUN go get -u github.com/golang/dep/...
ADD ./api/Gopkg.* $D/api/
RUN cd $D/api && dep ensure -v --vendor-only
# build
ADD ./api $D/api
@rbuck23
rbuck23 / books
Created June 15, 2017 17:55
Books I recommend for those in the field of Software Engineering
https://www.amazon.com/Mythical-Man-Month-Anniversary-Software-Engineering-ebook/dp/B00B8USS14/ref=dp_kinw_strp_1
https://www.amazon.com/Peopleware-Productive-Projects-Teams-Second/dp/0932633439
https://www.amazon.com/Visual-Display-Quantitative-Information/dp/1930824130 (I get up in arms about lie factor a lot. This is where that came from.)
https://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912
https://www.amazon.com/Phoenix-Project-DevOps-Helping-Business/dp/0988262509/ref=pd_lpo_sbs_14_t_1?_encoding=UTF8
https://www.amazon.com/Unix-Network-Programming-Sockets-Networking/dp/0131411551/ref=sr_1_1?s=books&ie=UTF8&qid=1495735490&sr=1-1&keywords=unix+network+programming
https://www.amazon.com/Right-Kind-Crazy-Leadership-High-Stakes-ebook/dp/B00SI02EQC/ref=sr_1_1?s=books&ie=UTF8&qid=1495735539&sr=1-1&keywords=the+right+kind+of+crazy
https://www.amazon.com/Debugging-Teams-Productivity-through-Collaboration/dp/1491932058/ref=sr_1_1?s=books&ie=UTF8&qid=1495735556&sr=1-1&keyw
@rbenigno
rbenigno / Send Outlook message to OmniFocus.scpt
Last active December 8, 2023 23:16
Add Outlook Items to OmniFocus
(*
Veritrope.com
Outlook 2011 to Omnifocus
VERSION 1.12
JANUARY 4, 2016
// SCRIPT INFORMATION AND UPDATE PAGE
http://veritrope.com/code/outlook-2011-to-omnifocus
// REQUIREMENTS
@patik
patik / how-to-squash-commits-in-git.md
Last active January 27, 2026 05:12
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@deanishe
deanishe / workflow-install.py
Last active July 29, 2024 18:06
Script to install/symlink Alfred workflows. Useful for workflow developers.
#!/usr/bin/python
# encoding: utf-8
#
# Copyright (c) 2013 <deanishe@deanishe.net>.
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2013-11-01
#
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@jboner
jboner / latency.txt
Last active March 16, 2026 22:58
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@btoone
btoone / curl.md
Last active March 13, 2026 03:04
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin