Skip to content

Instantly share code, notes, and snippets.

View shermaza's full-sized avatar

Zach Sherman shermaza

  • HiBob
  • Monroe, OR
View GitHub Profile
@shermaza
shermaza / university-of-auntimoany-ethnographical-questionnaire.md
Created May 5, 2023 04:21
The University of Auntimoany Ethnographical Questionnaire in Markdown Format

This is a transcription of http://www.bethisad.com/questionnaire.htm in markdown format for ease-of-use in things like Obsidian or Github

MONKS, Timothy Peter, Dr Dr Timothy Peter Monks

Part I: The Fundamentals of the World

Questions on the World Itself

  • What is this invented world called?
  • What kind of world is this?
  • Is it Earth, an Earth-like world, an alternate history Earth a completely alien planet?
@shermaza
shermaza / tables.sql
Created May 8, 2018 20:46
List all tables in a schema
SET @schema_name = 'magento';
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE='BASE TABLE'
AND TABLE_SCHEMA=@schema_name;
@shermaza
shermaza / save_image_field_from_url.py
Created April 30, 2018 04:05
Save an image from a url to a Django model ImageField
import os
import requests
from django.core.files.base import ContentFile
def save_image_field_from_url(model, field, url, filename):
image = requests.get(url)
getattr(model, field).save(
os.path.basename(filename),
ContentFile(image.content)
@shermaza
shermaza / gist:853140ccc3baee2e082e
Last active October 10, 2015 22:57
Finding the 30th bit of the *ecx register
#include "processor.h"
void native_cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) {
/* ecx is often an input as well as an output. */
asm volatile("cpuid"
: "=a" (*eax),
"=b" (*ebx),
"=c" (*ecx),
"=d" (*edx)
: "0" (*eax), "2" (*ecx));