Skip to content

Instantly share code, notes, and snippets.

@DraTeots
DraTeots / ComPort over Network.md
Last active April 18, 2024 16:21
ComPort over Network

Setup colima on ARM Mac to Run x86 Docker Images

Prerequisites

Install Rosetta for x86 instruction support on Mac

$ softwareupdate --install-rosetta
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active April 18, 2024 16:16
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@madjin
madjin / gltf_to_usd.py
Created April 16, 2024 21:05
Blender script to bake each object then export as glTF + USDZ
import bpy
import sys
import os
def unwrap_and_bake_texture(obj, bake_resolution):
# Select the object
bpy.ops.object.select_all(action='DESELECT')
obj.select_set(True)
bpy.context.view_layer.objects.active = obj
@donbr
donbr / README.md
Created April 18, 2024 16:13 — forked from disler/README.md
Use these Prompt Chains to build HIGH QUALITY AI Agents (Agentic Building Blocks)

Setup

  1. Create a new directory with these three files (requirements.txt, main.py, README.md)
  2. python -m venv venv
  3. source venv/bin/activate
  4. pip install -r requirements.txt
  5. python main.py
  6. Update main() to run the example prompt chains
@egernst
egernst / ipmi-sol.md
Created March 4, 2020 17:51 — forked from krsna1729/ipmi-sol.md
ipmi serial over lan sol

Pre-requisites

Install IPMItools using your package manager on laptop and target machine. Load the drivers on the target.

modprobe ipmi_devintf
modprobe ipmi_si

If you see the following, drivers are not loaded.

@Aschen
Aschen / README.md
Last active April 18, 2024 16:10
Scrape a page and convert it to Markdown

Scrape a page and convert it to Markdown

Install dependencies: npm install playwright cheerio node-html-markdown

Install firefox browser: npx playwright install firefox

Run the script: tsx html-to-md.ts https://mistral.ai/fr/news/mixtral-8x22b/

@phineas-pta
phineas-pta / dl_requests_tqdm.py
Last active April 18, 2024 16:10 — forked from yanqd0/dl_requests_tqdm.py
Python requests download file with a tqdm progress bar
import os
import requests
import werkzeug
from tqdm import tqdm
def download_ckpt(url:str, filename:str="", overwrite:bool=False, chunk_size:int=1) -> None:
"""
try auto detect file name if left empty
option to overwrite if file already existed
@battenr
battenr / collider_bias.R
Created April 18, 2024 15:22
Proving Collider Bias
# Title: Conditioning on a Collider
# Description: Directed acyclic graphs (DAGs) are a great tool that can be
# used to guide variable selection. Colliders, a variable where two arrowheads meet,
# should not be adjusted for since they can induce bias. This code aims to prove
# and quantify the bias using a simple example.
# Setup ----
#... Libraries ----
@k4ml
k4ml / messaging.py
Created January 29, 2014 23:26
POPO - Plain Old Python Object
class Messaging(object):
def __init__(self, user, sender, receiver, message):
self.user = user
self.sender = sender
self.receiver = receiver
self.message = message
def send(self):
required_points = self.get_required_points()
if required_points > self.user.points: