Skip to content

Instantly share code, notes, and snippets.

@lee8oi
lee8oi / startProcess.go
Last active January 9, 2025 15:31
Using os.StartProcess() in Go for platform-independent system command execution.
package main
import (
"os"
"os/exec"
)
func Start(args ...string) (p *os.Process, err error) {
if args[0], err = exec.LookPath(args[0]); err == nil {
var procAttr os.ProcAttr
@Hypnosphi
Hypnosphi / docker-shell.sh
Created November 29, 2019 17:53 — forked from falvarez/docker-shell.sh
Run docker container, mount current working directory and get interactive shell
docker run -ti -v $(pwd):/tmp -w /tmp DOCKER_IMAGE /bin/bash
@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active January 9, 2025 15:30
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@j33ty
j33ty / print-memory.go
Created May 22, 2019 20:54
Go print current memory
package main
import (
"runtime"
"fmt"
"time"
)
func main() {
// Print our starting memory usage (should be around 0mb)
using UnityEngine;
using TMPro;
// NOTE: Make sure to include the following namespace wherever you want to access Leaderboard Creator methods
using Dan.Main;
namespace LeaderboardCreatorDemo
{
public class LeaderboardManager : MonoBehaviour
{
@snowflower
snowflower / _expm1.gd
Created January 9, 2025 08:54
Compute exp(x) - 1 without loss of precision for small values of x. example snippet from godot game code
##
## Compute exp(x) - 1 without loss of precision for small values of x.
## https://www.johndcook.com/blog/cpp_expm1/
##
## usage for exponential smoothing in games/animation e.g.:
## for any value of dt (delta time):
##
## position += (target - position) * (1 - exp(- speed * dt))
##
## changed to use -expm1(x) instead of 1-exp(x)
@gandy92
gandy92 / spool.py
Created May 14, 2020 05:04
Python3 code to demonstrate how the data on the NFC tag on an Ultimaker material spool is organised
# -*- coding: utf-8 -*-
#
# required packages: ndeflib, crc8
#
from crc8 import crc8
import ndef
import uuid
class UltimakerMaterialRecord(ndef.record.GlobalRecord):
@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active January 9, 2025 15:23 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "[email protected]"