Skip to content

Instantly share code, notes, and snippets.

@iamralch
iamralch / ssh_client.go
Last active August 21, 2024 05:26
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@awmichel
awmichel / README.md
Last active May 17, 2024 04:23
Docker Machine OSX Autostart

Docker Machine OSX Autostart

This is a simple launchd config that will start your default docker-machine on startup. You can customize the machine that is started by updating lines 11 and 16 with the correct machine name.

Install

  1. Copy the file com.docker.machine.default.plist below to ~/Library/LaunchAgents/com.docker.machine.default.plist.
  2. Run the following in a terminal: launchctl load ~/Library/LaunchAgents/com.docker.machine.default.plist
  3. Profit!
@billinghamj
billinghamj / main.go
Created April 6, 2016 11:38
Go JWT Generator - ES512 with OpenSSL PEM format keys
package main
import (
"crypto"
"crypto/x509"
"encoding/pem"
"fmt"
"github.com/dgrijalva/jwt-go"
"io/ioutil"
"time"
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active March 16, 2025 22:37
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@marians
marians / main.go
Created January 27, 2017 10:25
OAuth 2.0 authentication in a Golang CLI
package main
import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"net/url"
"time"
@peterhellberg
peterhellberg / minimal-graceful-server.go
Last active September 19, 2017 08:49
Minimal graceful Go 1.8+ server example
package main
import (
"encoding/json"
"log"
"net/http"
"os"
env "github.com/TV4/env"
graceful "github.com/TV4/graceful"
@addisonschultz
addisonschultz / useScript.tsx
Last active October 28, 2023 10:02
A React hook that lets you add script tags to a component. Useful when needing to load scripts for components in Framer X.
import * as React from "react"
import { useState, useEffect } from "react"
// Hook
let cachedScripts = []
export function useScript(src) {
// Keeping track of script loaded and error state
const [state, setState] = useState({
loaded: false,
#if UNITY_EDITOR
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Reflection;
using System.IO;
using System.Text;
public class EditorFontResizer : EditorWindow {
@MelbourneDeveloper
MelbourneDeveloper / mostchanged.sh
Created December 20, 2023 09:17
Get Most Changed Files
#!/bin/bash
# This script finds the files with the most changes in a Git repository, tracking renames and excluding binary files and files with zero changes
# Check for the presence of a Git repository
if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
echo "This script must be run inside a Git repository."
exit 1
fi