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 28, 2023 21:09
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

@EpicWink
EpicWink / _docker_patch.py
Last active February 12, 2020 21:40
Patch Docker for Python with device-requests, from https://github.com/docker/docker-py/pull/2471
# Licensed under the Apache License, Version 2.0
# License included at https://github.com/docker/docker-py/blob/master/LICENSE
"""Patch Docker for Python with device-requests."""
from docker.types import base as docker_types_base
from docker.models import containers as docker_models_containers
from docker.types import containers as docker_types_containers
from docker.utils import utils as docker_utils
@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
@andrewjong
andrewjong / pytorch_image_folder_with_file_paths.py
Last active February 27, 2024 09:24
PyTorch Image File Paths With Dataset Dataloader
import torch
from torchvision import datasets
class ImageFolderWithPaths(datasets.ImageFolder):
"""Custom dataset that includes image file paths. Extends
torchvision.datasets.ImageFolder
"""
# override the __getitem__ method. this is the method that dataloader calls
def __getitem__(self, index):
@jbenet
jbenet / propose-ipfs-pack.md
Created December 23, 2016 11:47
ipfs-pack and friends

IPFS Tooling for datasets

Background

We need some tooling for a certain set of use cases around archival and dataset management. This tooling is for fitting how people work with large files and large datasets.

Grounding Assumptions

Basic grounding assumptions here:

  • datasets are "large" (From GB to EB in size)
@jbn
jbn / aiohttp_uptime_http_server.py
Created April 7, 2016 12:24
An example showing how to stream HTML in a aiohttp server.
import asyncio
from aiohttp import web
import subprocess
async def uptime_handler(request):
# http://HOST:PORT/?interval=90
interval = int(request.GET.get('interval', 1))
# Without the Content-Type, most (all?) browsers will not render
@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
@acdha
acdha / custom-log-filtering-and-formatting.py
Created February 26, 2014 21:19
Example of how to filter or apply custom formatting using Python's logging library
#!/usr/bin/env python
# encoding: utf-8
from pprint import pformat, pprint
import logging
class PasswordMaskingFilter(logging.Filter):
"""Demonstrate how to filter sensitive data:"""
#!/usr/bin/env python
import sys
import os
import boto
import pprint
del_flag = ''
if len(sys.argv) > 1:
del_flag = sys.argv[1]
@itsderek23
itsderek23 / Dockerfile
Created August 27, 2013 02:09
Example Docker File to start a Rails app located in a local ./docker-rails directory.
# docker build -t="rails" .
FROM ubuntu:12.04
RUN apt-get update
## MYSQL
RUN apt-get install -y -q mysql-client libmysqlclient-dev
## RUBY