Skip to content

Instantly share code, notes, and snippets.

import re
import random
board = ""
player=None #current player
playAgain = True
humanplayer=''
aiplayer=''
moves=[]
def initBoard(): #board is a string
global.THREE = require("three");
const canvasSketch = require('canvas-sketch');
const Random = require('canvas-sketch-util/random');
const gradientHeight = 512;
const settings = {
dimensions: [ 2048, gradientHeight * 2 ]
};
@benmarwick
benmarwick / object-outline-and-dimensions-opencv.py
Last active January 18, 2025 20:39
Python 3 script to take live video, detect the largest object, trace an outline (contour) and measure linear dimensions, using OpenCV
# in a terminal
# python -m pip install --user opencv-contrib-python numpy scipy matplotlib ipython jupyter pandas sympy nose
import cv2
import pandas as pd
import numpy as np
import imutils
from scipy.spatial import distance as dist
from imutils import perspective
@p01
p01 / index.html
Last active August 25, 2022 18:57
Face detection in 280 bytes
<canvas id=a><video id=v><svg onload="navigator.getUserMedia({video:1},n=m=>{v.src=top.URL.createObjectURL(m);setInterval(async(c=a.getContext`2d`)=>{c.drawImage(v,0,0,208,150);for(i of await new FaceDetector().detect(a))with(i.boundingBox)c.strokeRect(x,y,width,height)},9)},n)">
@derhuerst
derhuerst / awesome-twitter-bots.md
Last active April 7, 2023 17:45
Awesome Twitter Bots
@labnol
labnol / google-apps-script.md
Last active October 1, 2025 19:50 — forked from junaidk/resources.md
How to Learn Google Apps Script

Learning Google Apps Script

Find the best resources for learning Google Apps Script, the glue that connects all Google Workspace services including Gmail, Google Drive, Calendar, Google Sheets, Forms, Maps, and more.

A good place to learn more about Google Apps Script is the official documentation available at developers.google.com. Here are other Apps Script resources that will help you get up to speed.

  1. Google Apps Script Code Samples by Amit Agarwal
  2. Google Apps Script Development - Create Google Apps Script projects locally inside VS Code - video tutorial
  3. Awesome Google Scripts by Amit Agarwal
  4. Google Developer Experts - Follow Apps Scr
@electronut
electronut / ldr.py
Created May 4, 2014 06:14
Display analog data from Arduino using Python (matplotlib animation)
"""
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import sys, serial, argparse
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.