Skip to content

Instantly share code, notes, and snippets.

View Integralist's full-sized avatar
🎯
Making an impact

Mark McDonnell Integralist

🎯
Making an impact
View GitHub Profile
@Integralist
Integralist / dependencies.yaml
Created September 12, 2024 07:15
[GitHub Actions update app dependencies daily] #ci #gha #github #actions #cron #go #golang
name: Update Dependencies and Run Tests
on:
# Schedule to run at 9am UTC every day
schedule:
- cron: '0 9 * * *'
# Allow manual trigger via GitHub UI
workflow_dispatch:
@Integralist
Integralist / What is a SKU.md
Created September 4, 2024 15:57
[What is a SKU] #sku

SKU stands for stock-keeping unit.

It is mostly the unit used by Salesforce, and all other business systems to 'sell' and invoice for products/features we sell

It can take up to a quarter or more to get a SKU.

You can't sell something for $$ without a SKU.

Monetization engineering often won't get started on any work without a SKU/product description in Salesforce.

@Integralist
Integralist / README.md
Created August 6, 2024 19:34
[Pagination: offset vs cursor] #pagination #design

What is pagination?

We use pagination to request specific segments of a dataset from an API (and a database) instead of everything at once.

Offset-based pagination

The use of offset-based pagination requires passing:

  • A limit: the number of records per page
  • An offset: the position of the first item of a page
@Integralist
Integralist / main.go
Last active August 6, 2024 16:15
[Go and the goto statement] #go #golang #goto
// https://play.golang.com/p/EAtzwpDeb30
// https://go.dev/ref/spec#Goto_statements
package main
import (
"fmt"
)
func main() {
@Integralist
Integralist / README.md
Last active July 18, 2024 09:48
[Golang f-tests replace table-driven tests] #go #golang #tests
@Integralist
Integralist / README.md
Created June 26, 2024 15:28
Separate the musical instruments from a song and make an instrumental
@Integralist
Integralist / Vim for beginners.md
Created June 5, 2024 06:01
[Vim beginner notes] #vim #beginner

There are many 'motions' and things you can do but I would probably say there are some essential motions you'll use a lot...

  • :<LINE_NUMBER> to jump to a specific line number (e.g. :10)
  • gg to go to the top of the file (G to go to the bottom)
  • Ctrl+d to go down half a page (Ctrl+u to go up half a page)
  • { and } to jump back and forth between paragraphs
  • f<CHARACTER> to jump forward on the current line to a specific character (use F to search backwards in the line).
  • ^ to go to the start of the line (0 if you want to specifically go back to the zero column)
  • $ to go to the end of the line
  • / to search for text in the current buffer (see https://www.vimregex.com/ or use \v flag to make regexes a bit more sane, e.g. `/\v
@Integralist
Integralist / filerename.sh
Created May 22, 2024 08:17
[Rename files matching specific pattern] #shell #bash #macos #files #rename
#!/bin/bash
# Iterate over each MP4 file in the current directory
for file in *.mp4; do
# Check if the file matches the pattern: MMDDYYYY <NAME>.mp4
if [[ "$file" =~ ^([0-9]{2})([0-9]{2})([0-9]{4})\ (.*)\.mp4$ ]]; then
# Extract the parts of the filename
MM="${BASH_REMATCH[1]}"
DD="${BASH_REMATCH[2]}"
YYYY="${BASH_REMATCH[3]}"
@Integralist
Integralist / README.md
Created May 15, 2024 09:10
[Proxy HTTP requests through a SSH connection via SOCKS5 proxy] #ssh #proxy #tunnel

https://www.linkedin.com/pulse/proxying-web-traffic-via-ssh-mark-el-khoury

Essentially your local machines creates a SOCK5 proxy which connects to a remote server via SSH (using either username/password or SSH PKI Cert/Key combination).

The SOCK5 proxy handles sending the HTTP request via the SSH tunnel.

The remote server will automatically process the HTTP request and handle sending it to its intended destination.

The upstream (i.e. the endpoint being requested) will see the request coming from the SSH server and presume that's where it originated.

@Integralist
Integralist / README.md
Created May 13, 2024 15:10
[Highligh notes and warnings in Markdown] #gist #github #notes