Skip to content

Instantly share code, notes, and snippets.

@VeryFatBoy
VeryFatBoy / humanity_globe.R
Created December 24, 2025 18:09 — forked from tylermorganwall/humanity_globe.R
3D Humanity Globe
library(rayshader)
library(rayrender)
popdata = raster::raster("gpw_v4_population_density_rev11_2020_15_min.tif")
population_mat = rayshader:::flipud(raster_to_matrix(popdata))
above1 = population_mat > 1
above5 = population_mat > 5
above10 = population_mat > 10
import sys
import numpy as np
from PIL import Image
import argparse
import os
def create_autostereogram(pattern_path, depth_map_path, output_path, repeat_width=128):
"""
Generate an autostereogram from a pattern image and a depth map.
@VeryFatBoy
VeryFatBoy / StackOverflow Stats.md
Created February 8, 2025 01:19 — forked from hopeseekr/StackOverflow Stats.md
StackOverflow Dec 2024 stats

Disclaimer: I'm in the Top 1% of StackOverflow contributors with 23,315 rep points.

I asked 1 high-quality question in 2024, and it was closed almost immediately, and I haven't engaged with the site since.

If someone with 20,000+ karma has their nicely-formatted questions closed so quickly, what must the newbies and rank-in-file encounter? This is probably a big reason why it's declining.


@VeryFatBoy
VeryFatBoy / grpo_demo.py
Created January 31, 2025 14:52 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
@VeryFatBoy
VeryFatBoy / DEFRA AUR Data Downloader.ipynb
Created March 28, 2023 10:50 — forked from psychemedia/DEFRA AUR Data Downloader.ipynb
DEFRA AUR Data Downloader - quick hack for downloading UK air quality data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import pandas as pd
import geopandas as gpd
from shapely import wkt
import time
# Read pub points from CSV to a pandas dataframe
pubs = pd.read_csv('~/Documents/pub_points.csv',
header=None, names=['name', 'coordinates'])
# Parse the WKT coordinate format from PostGIS
version: '2'
services:
memsql:
image: 'memsql/cluster-in-a-box'
ports:
- 3306:3306
- 8080:8080
environment:
LICENSE_KEY: ${LICENSE_KEY}
# A deployment ensures pod(s) are restarted on failure
apiVersion: apps/v1
kind: Deployment
metadata:
name: memsql
spec:
replicas: 1 # only create one pod (container)
selector:
matchLabels:
app: memsql
CREATE DATABASE hellomemsql;
USE hellomemsql;
CREATE TABLE test (
message text NOT NULL
);
INSERT INTO test (message) VALUES ('this is a sample message');
@VeryFatBoy
VeryFatBoy / Vagrantfile
Created October 12, 2021 16:35 — forked from robrich/Vagrantfile
MemSQL Vagrant Dev Cluster
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu1904"
# set the provider
config.vm.provider "virtualbox"
# configure the provider
config.vm.provider "virtualbox" do |v|
v.cpus = 4
v.memory = 4096
end