Skip to content

Instantly share code, notes, and snippets.

@popey456963
popey456963 / cube.stl
Last active July 5, 2021 11:37
Making Cubes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@popey456963
popey456963 / sim.py
Created April 2, 2021 17:20
Codenames bot
import math
import random
import numpy as np
import time
from fastapi import FastAPI
from pydantic import BaseModel
from typing import List
beginInit = time.time()
// schrodingers value
true == []; // -> false
true == ![]; // -> false
// reading between the lines
(![] + [])[+[]] +
(![] + [])[+!+[]] +
([![]] + [][[]])[+!+[] + [+[]]] +
(![] + [])[!+[] + !+[]];
// -> 'fail'
@popey456963
popey456963 / header.css
Created January 29, 2019 22:04
Milligram NavBar
.wrapper{
display:block;
overflow:hidden;
position:relative;
width:100%
}
.wrapper .container{
/*max-width:80rem*/
}
.wrapper>.container{
@popey456963
popey456963 / bot.py
Created July 2, 2017 14:33
Tron Battle
import collections
import operator
import sys
import uuid
# Optimization helpers.
def memoize(func):
"""Memoizing decorator for functions which take a grid as their first argument. Since a grid is 1) large and
@popey456963
popey456963 / skel_commented.py
Created May 2, 2017 11:10
Wikibooks Solutions
#Skeleton Program code for the AQA A Level Paper 1 2017 examination
#this code should be used in conjunction with the Preliminary Material
#written by the AQA Programmer Team
#developed in the Python 3.4.1 programming environment
# Enumerate over a class
import enum
# Contains functions to generate random numbers, pick a random item from
# an array, etc.
import random
@popey456963
popey456963 / bot.js
Created January 29, 2017 00:12
JavaScript Wrapper
var chalk = require('chalk')
var generate = require('project-name-generator')
var Bot = function() {
this.pastPlayers = 0
this.playerIndex = 0
this.colours = {
"empty": chalk.gray,
"mountain": chalk.white,
"unknown": chalk.yellow,
@popey456963
popey456963 / error.js
Created January 24, 2017 19:15
Mocha Error
C:\Users\Alexander\Documents\GitHub\generals.io\node_modules\jstransform\src\jstransform.js:277
throw e;
^
at throwError (C:\Users\Alexander\Documents\GitHub\generals.io\node_modules\jstransform\node_modules\esprima-fb\esprima.js:2808:21)
at throwUnexpected (C:\Users\Alexander\Documents\GitHub\generals.io\node_modules\jstransform\node_modules\esprima-fb\esprima.js:2870:9)
at parsePrimaryExpression (C:\Users\Alexander\Documents\GitHub\generals.io\node_modules\jstransform\node_modules\esprima-fb\esprima.js:3575:9)
at parseLeftHandSideExpressionAllowCall (C:\Users\Alexander\Documents\GitHub\generals.io\node_modules\jstransform\node_modules\esprima-fb\esprima.js:3656:61)
at parsePostfixExpression (C:\Users\Alexander\Documents\GitHub\generals.io\node_modules\jstransform\node_modules\esprima-fb\esprima.js:3696:20)
at parseUnaryExpression (C:\Users\Alexander\Documents\GitHub\generals.io\node_modules\jstransform\node_modules\esprima-fb\esprima.js:3763:16)
at parseBinaryExpression (
@popey456963
popey456963 / bot.js
Created December 22, 2016 23:20
Generals Bot
var chalk = require('chalk')
var generate = require('project-name-generator')
var Bot = function() {
this.pastPlayers = 0
this.playerIndex = 0
this.colours = {
"empty": chalk.gray,
"mountain": chalk.white,
"unknown": chalk.yellow,
@popey456963
popey456963 / bot.js
Created December 16, 2016 21:34
A JS Bot
var socket = require('socket.io-client')('http://localhost:8080', { transports: ['websocket'] })
var chalk = require('chalk')
var listen_events = ['queue_update', 'game_update']
socket.on('connect', function() {
console.log('Connected Successfully')
socket.emit('play', 'Beep Boop', 'Sy5tdf37g')
socket.emit('set_force_start', null, true)
})