Skip to content

Instantly share code, notes, and snippets.

View greenstevester's full-sized avatar

steve greensill greenstevester

  • switzerland
View GitHub Profile
@greenstevester
greenstevester / Instructions.MD
Created January 5, 2025 10:22 — forked from diogogpinto/Instructions.MD
Best Laravel AI Prompt to use with Claude

I have been utilizing artificial intelligence to enhance and optimize my codebases. After evaluating various models, applications, and editors, I find the claude.ai interface with a Pro Account to be the most effective. Here’s the approach I’ve developed to achieve optimal results:

This gist contains a carefully crafted prompt and a script designed to convert your entire Laravel codebase (excluding the resources folder, which can be easily added if needed) into a TXT file with the following structure:

<File Start: ./path/filename.extension> Content of file <End File: ./path/filename.extension>

To implement this method:

#!/bin/bash
BOT_TOKEN="<token>"
CHAT_ID="<id>"
TELEGRAM_USERNAME="<username>"
send_telegram_message() {
local message="$1"
curl -s -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \
-d chat_id="$CHAT_ID" \
How to Build a Bitcoin Full Node on a Raspberry Pi 3.
What is a Bitcoin Full Node?
-------------------------------
A Bitcoin full node is much simpler than it sounds.
A full node is simply a computer that is running the Bitcoin Core Wallet.
The Bitcoin Core Wallet, by default, downloads a full copy of the Blockchain.
A. You'll need a 1 TB Hard Drive as of 18.12.2023, its circa 534 GB see https://www.blockchain.com/explorer/charts/blocks-size
@greenstevester
greenstevester / latency.md
Created February 14, 2022 14:46 — forked from l2dy/latency.md
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

This ensures you have npm setup and configured correctly on osx.
see http://dreamerslab.com/blog/en/npm-basic-commands/
see https://www.sitepoint.com/beginners-guide-node-package-manager/
npm config ls -l
npm config set loglevel info
npm config set registry http://registry.npmjs.org/
npm set progress=false
npm install --verbose
Pre-requisite: brew
NOTE: This install is based on nvm:
see http://dev.topheman.com/install-nvm-with-homebrew-to-use-multiple-versions-of-node-and-iojs-easily/
see also http://stackoverflow.com/questions/28017374/what-is-the-suggested-way-to-install-brew-node-js-io-js-nvm-npm-on-os-x
1. brew update
2. brew install nvm
3. Create NVM's working directory if it doesn't exist:
mkdir ~/.nvm
@greenstevester
greenstevester / latency.txt
Created October 23, 2021 15:47 — forked from jboner/latency.txt
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
@greenstevester
greenstevester / terraform-kubernetes-docker-macos.md
Created September 9, 2021 10:53 — forked from ivaravko/terraform-kubernetes-docker-macos.md
The simple Terraform and Kubernetes with Docker on macOS

If you'd like to experiment with Terraform and Kubernetes on macOS locally, a great provider for doing so is the Kubernetes provider. You can get set up in a few simple steps, like so:

1. Install Docker

Install Docker for Mac if you have not already.

@greenstevester
greenstevester / gist:740b562bcc7910656b4e0465a84fdb0a
Last active April 22, 2019 12:40
Uninstall Oracle Java on Mac OSX using the Terminal / Install AdoptOpenJDK using homebrew
Remove Java from the Apple System Preferences Pane
----------------------------------------------------
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -fr ~/Library/Application\ Support/Oracle/Java
Install with Homebrew
---------------------
install Homebrew if you haven't already. Make sure it is updated:
@greenstevester
greenstevester / gist:3e32b00884af8d42b9506237652dffdf
Last active April 24, 2019 14:41
upgrading angular-cli to the new package @angular/cli
npm uninstall -g angular-cli
npm cache clean --force
npm install -g @angular/cli@latest