Skip to content

Instantly share code, notes, and snippets.

View Camto's full-sized avatar
🐿️
hello

Benjamin Philippe Applegate Camto

🐿️
hello
View GitHub Profile
{-# LANGUAGE NamedFieldPuns #-}
import Control.Monad
import Data.Functor
import qualified Data.Array as Arr
import Data.Array ((!))
import qualified Data.Char as C
import qualified System.Environment as Env
data Length_State = Length_State {
<style>
code {
background-color: lightgray;
padding: 2px;
border-radius: 3px;
border: 1px gray;
}
li {
margin-bottom: 3px;
@Camto
Camto / Microsoft.PowerShell_profile.ps1
Created March 9, 2021 19:27
My PowerShell $PROFILE.
if($IsWindows) {
$BEN = 'D:\Users\Camto\Documents\Ben'
} else {
$BEN = '/home/camto/Ben'
}
# https://gist.github.com/thomastay/ae9e7245f752a195a5a82032a9060f13
# Modified and hopelessly broken, but works
# Still doesn't work for Linux
@Camto
Camto / aliases.json
Last active March 17, 2021 14:43
My Ladbot Console config.
{
"s": "server",
"c": "channel",
"st": "stack",
"aa": "addalias",
"gsl": "genspeaklink",
"ping": "mention",
"lc": "listchannels",
"lcn": "listchannelnames",
"gc": "getchannel"
import argparse
from enum import Enum
DEBUG = 0
def dprint(*s, v=0):
if DEBUG > v:
print(*s)
class State(object):
@Camto
Camto / thinmg.py
Last active January 16, 2019 23:25
import random
class Player:
def __init__(self):
self.bullets = 0
self.blocking = False
self.being_shot = False
def is_alive(self):
return self.blocking or not self.being_shot
def round_reset(self):
@Camto
Camto / Plane Trip 1.html
Created November 25, 2018 20:29
I made this without an internet connection or docs on a plane trip.
<html>
<body style = "background-color: white;">
<button id = "select">select</button>
<button id = "start" style = "color: black;">start</button>
<script>
function Init() { // Initialize the game.
screen = document.createElement("canvas"); // The game screen.
draw = screen.getContext("2d");
@Camto
Camto / Getlangs.js
Last active May 1, 2020 16:40
Automatically get all the languages from esolangs.org .
"use strict";
var writeFileSync = require("fs").writeFileSync;
var execSync = require("child_process").execSync;
var request = require("sync-request");
var regexes = [
/(.|[\r\n])+<div lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-category">/,
/(.|[\r\n])+\(next page\)<div lang="en" dir="ltr" class="mw-content-ltr"><h3>.+<\/h3>/,
/<\/div><\/div><\/div>(.|[\r\n])+/,
import Data.List
import Data.List.Split
import Data.Function
import Text.Read
data Player = White | Black deriving (Eq, Ord)
instance Show Player where
show White = "w"
show Black = "b"
@Camto
Camto / Name slider.html
Created September 22, 2018 21:00
A name slider for r/badUIbattles.
<!DOCTYPE html>
<html>
<head>
<title>Enter your first name:</title>
<style>
#name {
cursor: text;
border: 1px solid black;
width: 20em;