Skip to content

Instantly share code, notes, and snippets.

# IDEAS FOR COMPUTERIZED OPPONENT:
# [] Add prompt for 1 Player or 2 Player at start of game
# [] Based on number of players, override player selection with random computer selection
# [] Once random selection is working, add more intelligent computer selection (some ideas):
# * If computer could win game, it should win game
# * If computer can put board in state where next move it could win game, it should do that move
# * If computer can put board in state where next move it could win game REGARDLESS of human selection, do that move
# * Apply deep learning on millions of games of tic tac toe to become the ultimate RecurseTacToe algorithm (just kidding :D)
@robinovitch61
robinovitch61 / game_of_life.py
Created September 25, 2019 18:49
First pair programming at RC - Game of Life
import numpy as np
from scipy.ndimage import convolve
import matplotlib.pyplot as plt
import matplotlib
import copy
# Setup
BOARD_WIDTH = 10
BOARD_HEIGHT = 10
BOARD = np.zeros((BOARD_HEIGHT, BOARD_WIDTH))
<!DOCTYPE html>
<html>
<head>
<!-- ################### -->
<!-- STYLE -->
<!-- ################### -->
<style>
body {
margin: 0;
}
@robinovitch61
robinovitch61 / threading.ipynb
Last active October 30, 2019 00:25
Multithreading in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robinovitch61
robinovitch61 / race_condition.ipynb
Last active October 30, 2019 16:14
race_condition.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robinovitch61
robinovitch61 / multiprocessing.ipynb
Last active October 30, 2019 17:20
multiprocessing.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robinovitch61
robinovitch61 / pyenv_setup.md
Last active January 27, 2021 22:11
pyenv setup

pyenv is a python version manager. It allows you to install, activate, and set a system default for python versions like python 2.7, python 3.9, etc.

  1. Install pyenv:
curl https://pyenv.run | bash
  1. Add the following to your ~/.bashrc or ~/.zshrc
eval "$(pyenv init -)"
  1. Clone the example repo and edit this part of this file
  omeroweb:
    image: "openmicroscopy/omero-web-standalone:5.6" <---- find the name and tag on dockerhub of the one you want
    environment:
      OMEROHOST: omeroserver
    networks:
      - omero
    ports:
 - "4080:4080"
@robinovitch61
robinovitch61 / pannable-zoomable-html5-canvas-react-typescript.tsx
Last active May 22, 2024 14:39
A pannable, zoomable, html5 canvas in React and Typescript
// sandbox here: https://codesandbox.io/s/p3itj?file=/src/Canvas.tsx
import {
useEffect,
useCallback,
useLayoutEffect,
useRef,
useState
} from "react";
import * as React from "react";
@robinovitch61
robinovitch61 / unsubscribe.js
Created March 11, 2022 18:21
Bookmarklet for unsubscribe button big
// https://caiorss.github.io/bookmarklet-maker/
const anchors = Array.from(document.getElementsByTagName("a"))
console.log(anchors);
const unsubscribe = anchors.find(anchor => anchor.innerText.toLowerCase().includes("unsubscribe")).cloneNode(true)
unsubscribe.innerText = "UNSUBSCRIBE"
unsubscribe.style.fontSize = "50px"
document.body.prepend(unsubscribe)