Skip to content

Instantly share code, notes, and snippets.

@rokups
rokups / CMakeLists.txt
Last active May 11, 2024 07:29
Dear ImGui CMake build script.
#
# CMake build system for Dear ImGui
# =================================
#
# Build instructions:
# 1. Install latest CMake
# * Windows: https://cmake.org/download/ (Tick checkbox to place cmake in system PATH)
# * Linux: from your favorite package manager
# * MacOS: brew install cmake
# 2. Open command prompt in directory containing "imgui" and "imgui_dev" folders
@jrknox1977
jrknox1977 / ollama_dspy.py
Created February 9, 2024 18:06
ollama+DSPy using OpenAI APIs.
# install DSPy: pip install dspy
import dspy
# Ollam is now compatible with OpenAI APIs
#
# To get this to work you must include `model_type='chat'` in the `dspy.OpenAI` call.
# If you do not include this you will get an error.
#
# I have also found that `stop='\n\n'` is required to get the model to stop generating text after the ansewr is complete.
# At least with mistral.
import struct
import fastlz
file = open("/home/dexter/sc/snoita/save00/world/world_0_0.png_petri", "rb")
file_content = file.read()
# This uses little-endian, the rest of the file uses big-endian
compressed_size, uncompressed_size = struct.unpack("<ii", file_content[0:8])
@yorickdowne
yorickdowne / HallOfBlame.md
Last active May 11, 2024 07:24
Great and less great SSDs for Ethereum nodes

Overview

Syncing an Ethereum node is largely reliant on IOPS, I/O Per Second. Budget SSDs will struggle to an extent, and some won't be able to sync at all.

This document aims to snapshot some known good and known bad models.

For size, 4TB comes recommended as of mid 2024. The smaller 2TB drive should last an Ethereum full node until early 2025 or thereabouts, with crystal ball uncertainty. Remy wrote a migration guide to 4TB.

High-level, QLC and DRAMless are far slower than "mainstream" SSDs. QLC has lower endurance as well. Any savings will be gone when the drive fails early and needs to be replaced.

@kwea123
kwea123 / f2nerf-fig4.ipynb
Last active May 11, 2024 07:23
Script to interactively understand Fig. 4 in F2-NeRF (2d toy example with 2 cameras)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smdabdoub
smdabdoub / merge_git_repo_as_subdir
Created June 9, 2015 14:02
Merge one git repository into another repository as a sub-directory
# based on the following:
# http://saintgimp.org/2013/01/22/merging-two-git-repositories-into-one-repository-without-losing-file-history/
# http://blog.caplin.com/2013/09/18/merging-two-git-repositories/
git clone repo_main
git clone repo_sub
cd repo_main
git remote add repo_sub ../repo_sub
git fetch repo_sub
@shahanahmed86
shahanahmed86 / oracle.md
Last active May 11, 2024 07:19
install oracle 11g database in ubuntu

Step 1: Download Oracle Database Express Edition.

http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html

Step 2: Instructions before install Oracle

1. Copy the downloaded file and paste it in home directory.

2. Unzip using the command:

unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

@erikyuzwa
erikyuzwa / wordpress-6-2-2-docker-compose.yml
Last active May 11, 2024 07:13
Wordpress 6.2.2 Docker Compose for Local Development
# create a local .env file with the following 4 properties:
#
# MYSQL_DATABASE=<something>
# MYSQL_USER=<something>
# MYSQL_PASSWORD=<something>
# MYSQL_ROOT_PASSWORD=<something>
#
# Note: I have had a LOT of issues working with anything newer then Docker Desktop v4.26.1
# If you're on something newer, then double check against this release.
#
@matusnovak
matusnovak / README.md
Last active May 11, 2024 07:10
GPG + Git SSH Authentication and Signing on Windows 10

GPG + Git SSH Authentication and Signing on Windows 10

Introduction

This simple Gist will explain how to settup your GPG key to work for SSH authentication (with Git) and Git commit signing on Windows 10. This may seem straightforward on Linux, but there are certain tweaks needed on Windows.

No Cygwin, no MinGW, no Git Bash or any other Linux emulated environment. This works in pure Windows 10.

Software needed