Skip to content

Instantly share code, notes, and snippets.

function setup()
{
console.log("Input:");
console.log("var hairs = [");
console.log(" { isPulled: false },");
console.log(" { isPulled: true },");
console.log(" { isPulled: false },");
console.log(" { isPulled: false },");
console.log("];");
<html>
<head>
<style>
div.block {
height: 20em;
width: 20em;
border: solid 1px black;
display: block;
background-image: url('http://thebrentc.co.uk/media/under-construction_t.png');
background-size: cover;
/* wp-config.php setup debugging */
if ($_SERVER['HTTP_HOST'] == "$DEVSITE") {
define('ENV',"DEV");
} else {
define('ENV',"PROD");
}
/**
* For developers: WordPress debugging mode.
*
dd bs=4M if=$1 of=$2 conv=fdatasync status=progress
@thebrentc
thebrentc / wipedrive.sh
Created July 13, 2019 13:16
DD wipe drive
sudo dd if=/dev/zero of=$1 bs=1M status=progress
wget --accept pdf,jpg --mirror --page-requisites --adjust-extension --convert-links --backup-converted --no-parent --progress=dots --nd $URL
/*
-e robots=off
--ignore-case
--random-wait
*/
from ubuntu:18.04
maintainer Brent C <thebrentc@gmail.com>
#update and get cobol pre-requisites
run apt-get update
run apt-get install -y gcc
run apt-get install -y libgmp3-dev libdb-dev
# install latest cobol
@thebrentc
thebrentc / b
Created March 15, 2019 12:26
Makes bookmark/shortcut files from command line
#!/bin/sh
#Linux
OUTPUT="[Desktop Entry]"
OUTPUT="$OUTPUT\nEncoding=UTF-8"
OUTPUT="$OUTPUT\nIcon=text-html"
OUTPUT="$OUTPUT\nType=Link"
read -p "Name? " NAME
OUTPUT="$OUTPUT\nName=$NAME"
read -p "URL? " URL
OUTPUT="$OUTPUT\nURL=$URL"
@thebrentc
thebrentc / evolve.java
Created December 9, 2013 21:39
GOL::evolve()
public void evolve()
{
/*
Any live cell with fewer than two live neighbours dies, as if caused by under-population.
Any live cell with two or three live neighbours lives on to the next generation.
Any live cell with more than three live neighbours dies, as if by overcrowding.
Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
*/
for (int c = 0; c < this.cols; c++) {
for (int r = 0; r < this.rows; r++) {