Skip to content

Instantly share code, notes, and snippets.

View crizCraig's full-sized avatar
🛰️
Journeying through levels of abstraction trying to land

Craig Quiter crizCraig

🛰️
Journeying through levels of abstraction trying to land
View GitHub Profile
@crizCraig
crizCraig / game_of_agi.md
Last active May 6, 2024 18:58
Game of AGI

Game of AGI

Play the game in Colab

View simulator source

Game of AGI (GOA) is a socio-techno monte carlo simulation which estimates the existential risk posed by AGI. You play by setting various factors, i.e. AI spending and AGI safety spending, along with their uncertainties and GOA returns the existential risk, corruption risk, and value alignment probability associated with your guesses by sampling 1M times from guassian distributions of your guesses.

N.B. When referring to AGI's as separate entities, I am referring to autonomous groups of humans (i.e. companies, governments, groups, organizations) that are in control of some tech stack capable of AGI. There may be several autonomous AGIs within any certain stack, but we assume they have an umbrella objective defined by

def generic_unsync(func: Callable[..., Any]) -> Callable[..., Any]:
"""
A function that dynamically decides whether to run asynchronously
or synchronously based on whether it's in an async context,
but always returns the result synchronously so that
you can use it from an async or sync context.
"""
from unsync import unsync # type: ignore # pylint: disable=import-outside-toplevel
@unsync # type: ignore
import asyncio
from typing import AsyncGenerator
async_q: asyncio.Queue[str] = asyncio.Queue()
async def producer() -> None:
try:
# Assuming `a` should be a value like 1, 2, etc.
# a = 1
await async_q.put(str(a)) # a not defined
@crizCraig
crizCraig / Values.md
Last active September 30, 2023 19:33
  1. Love, connection, caring, compassion, tolerance, helping others, sharing, and acceptance. We value the ability to love and to be loved, to connect with others, to care for others, to be compassionate, to be tolerant, to share, to help others, and to accept others.
  2. Freedom and autonomy. We value the ability to make our own decisions and to have control over our own lives. We value the ability to believe what we want, to have our own thoughts, and to have our own feelings. We value the ability to have our own opinions and to express them freely. We value the ability to have our own goals and to pursue them. We value the ability to have our own values and to live by them. We value the ability to have our own identity and to be ourselves.
  3. Harmony and peace. We value the ability to live in harmony with others and our surroundings and to live in peace without war, violence, or conflict.
  4. The right to life and the pursuit of happiness. We value the ability to live and to pursue happiness. We value the abi
@crizCraig
crizCraig / HOME-.inputrc
Created April 3, 2014 16:59
Auto search history with up/down in terminal
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
@crizCraig
crizCraig / timeit.py
Last active July 3, 2023 19:04
Python timing decorator to measure how long a function takes (handles async and sync)
import asyncio
import time
from typing import Callable, Any
def timed(fn: Callable[..., Any]) -> Callable[..., Any]:
"""
Decorator log test start and end time of a function
:param fn: Function to decorate
:return: Decorated function
@crizCraig
crizCraig / bash_boilerplate.sh
Last active October 27, 2022 20:30
bash boilerplate
#!/usr/bin/env bash
set -e # Abort script at first error, when a command exits with non-zero status (except in until or while loops, if-tests, list constructs)
set -u # Attempt to use undefined variable outputs error message, and forces an exit
set -x # Similar to verbose mode (-v), but expands commands
set -o pipefail # Causes a pipeline to return the exit status of the last command in the pipe that returned a non-zero return value.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# end boilerplate from: https://gist.github.com/crizCraig/f42bc250754bed764ada5f95d101dbea
@crizCraig
crizCraig / gtav_object_ids.txt
Created December 30, 2016 22:28
GTAV object ids
prop_a4_pile_01
prop_a4_sheet_01
prop_a4_sheet_02
prop_a4_sheet_03
prop_a4_sheet_04
prop_a4_sheet_05
prop_abat_roller_static
prop_abat_slide
prop_acc_guitar_01
prop_acc_guitar_01_d1
@crizCraig
crizCraig / gist:2816295
Created May 27, 2012 22:52
Download images from Google Image search using Python
import json
import os
import time
import requests
from PIL import Image
from StringIO import StringIO
from requests.exceptions import ConnectionError
def go(query, path):
"""Download full size images from Google image search.