Skip to content

Instantly share code, notes, and snippets.

View lrstanley's full-sized avatar
👋
Busy. All the time.

Liam Stanley lrstanley

👋
Busy. All the time.
View GitHub Profile
@maratori
maratori / .golangci.yml
Last active May 5, 2024 09:19
Golden config for golangci-lint
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers
## Golden config for golangci-lint v1.58.0
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt and change it for your needs.
run:
@crysxd
crysxd / README.md
Last active February 20, 2024 19:06
Syncing Cura Settings & Profiles Accross multiple devices

Syncing Cura Settings & Profiles Accross multiple devices

I use multiple devices to control my 3D printer and it's alwys a hassle to move changes on profiles etc. between those machines leading to situations where I use an old version of my profiles to print a part because I just forgot to update it.

Here is how you can sync Cura settings between multiple devices:

  1. Setup Google Drive / OneDrive / Dropbox on every machine you want to sync the Cura settings on
  2. Go to the following location and copy the folder called cura to any convinient location inside your Google Drive / OneDrive / Dropbox folder. You can also rename the folder form cura to somthing else, I called mine Cura Settings.
  • Windows: %userprofile%\AppData\Roaming\cura
@Merott
Merott / tailwind-colors-as-css-variables.md
Last active April 26, 2024 11:06
Expose Tailwind colors as CSS custom properties (variables)

This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root element.

There are a couple of main reasons this is helpful:

  • You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
  • You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.

See the Tailwind Plugins for more info on plugins.

@gmag11
gmag11 / rclone-mount@.service
Last active March 27, 2024 04:01
Mount multiple RClone remotes on boot with a single SystemD forking service definition
# Rclone mount on boot
# Copy file to: /etc/systemd/system
# You need to create a remote on RClone and a folder on your disk, both with same name <rclone-remote>
# This example uses /cloud/ folder as origin to mount all remotes, change it to your needs
# This example use a linux user named rclone. Create it or adapt it to your needs. Rclone will get config from that user's home folder
# Register new service by typing:
# sudo systemctl daemon-reload
# Do the next one for every remote you want to load on boot
# sudo systemctl enable rclone-mount@<rclone-remote>.service
# systemctl start rclone-mount@<rclone-remote>.service
@thrawn01
thrawn01 / main.go
Created December 3, 2018 20:34
etcd `concurrency.Election` example with connection interruption detection and initial leadership status reporting
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
@sdkks
sdkks / README.md
Last active March 5, 2024 06:17
How to SSH to Kubernetes Pod with SSH ProxyCommand using socat

Requirements

  1. socat
  2. kubectl with proper ~/.kube/config that can connect to your cluster
  3. Working knowledge of kubectl client
  4. OpenSSH client

How does it work?

  1. kubectl does port forwarding to sshd port of your pod. I'm using pm2 process managed to keep my services alive in my workstation container. If you have only sshd, easiest to use is dropbear
  2. ProxyCommand of OpenSSH client uses socat to redirect two way fd - to forwarded port of kubectl
  3. Voila! You are in
@vito
vito / build.yml
Last active March 31, 2022 23:11
kaniko concourse task
---
platform: linux
image_resource:
type: docker-image
source: {repository: gcr.io/kaniko-project/executor}
inputs:
- name: source
@tj
tj / output
Last active October 18, 2018 04:12
#!/bin/sh
eval `go build -work -a 2>&1` && find $WORK -type f -name "*.a" | xargs -I{} du -hxs "{}" | gsort -rh | sed -e s:${WORK}/::g
@hakobe
hakobe / client.go
Created September 23, 2016 16:33
golang unix domain socket
package main
import (
"io"
"log"
"net"
"time"
)
func reader(r io.Reader) {
@kennwhite
kennwhite / word_wrap.go
Last active February 6, 2022 06:11
Basic golang word wrap string split
/*
Wrap long lines on rough column boundaries at spaces
Working example: https://play.golang.org/p/3u0X6NyMua
Based on algo from RosettaCode, which is nifty
https://www.rosettacode.org/wiki/Word_wrap#Go
*/
package main
import (