Skip to content

Instantly share code, notes, and snippets.

#lang racket
(require math/array)
;; https://en.wikipedia.org/wiki/Conway's_Game_of_Life
;; These are the game rules for a single CELL which can be 1 (alive) or 0
;; dead. NEIGHBOR-COUNT is the number of live neighbors the cell has.
(define (game-rules cell neighbor-count)
(cond
;; Any live cell with fewer than two live neighbours dies, as if by
;; underpopulation.
Get-PnpDevice -FriendlyName *webcam*
Get-PnpDevice -FriendlyName *webcam* -Class Camera,image
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status OK).InstanceId
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status OK).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status Error).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status Error).InstanceId
@jlollis
jlollis / gitkeep.md
Last active April 9, 2025 15:48
.gitkeep - Push your entire folder structure to GitHub, including empty folders

.gitkeep

A .gitkeep file tells github to do the opposite of its default behaviour, which is to ignore empty folders.

If you want to track an empty folder, or a folder with untracked files, create a 0kb file with the .gitkeep file extension in that folder.

touch FOLDER_NAME/.gitkeep

@sinclairtarget
sinclairtarget / fish.sim
Last active December 29, 2024 03:36
Simula Demonstration
Simulation Begin
! We will use this as input to Normal() below ;
Integer seed;
! Utility method for logging messages along with the current simulation
time ;
Procedure log(message); Text message; Begin
OutFix(Time, 2, 0);
OutText(": " & message);
OutImage;
@jlollis
jlollis / Merge-PDF.ps1
Created January 13, 2019 02:35 — forked from aaroncalderon/Merge-PDF.ps1
Merge PDFs with PowerShell
#Not my code, this is from Mike Pfeiffer - http://mikepfeiffer.net/2010/03/how-to-merge-pdf-files-using-powershell-and-pdfsharp/
#Requires PDFSharp assembly libraries http://sourceforge.net/projects/pdfsharp/
#You need to load the assembly before you can use the function
#
#Merge-PDF -path c:\pdf_docs -filename c:\saved_docs.pdf
Add-Type -Path C:\assemblies\PdfSharp.dll
Function Merge-PDF {
@jlollis
jlollis / .emacs
Created October 1, 2018 00:29
.emacs settings
(package-initialize)
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(package-initialize)
'(packages-archives
(quote
(("gnu" . "http://elpa.gnu.org/packages/")
("Melpa" . "https://stable.melpa.org/packages/"))))
@danwhitston
danwhitston / wsl_first_time_setup.sh
Last active May 7, 2022 13:34
Setting up my WSL environment - includes git & key, rbenv, rbenv ruby-build, attis, imagemagick, ruby, bundler, mysql, mongodb, redis
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
ln -s "/mnt/c/Users/Daniel/Documents/homeflow" ~/homeflow
ln -s "/mnt/c/Users/Daniel/Documents" ~/documents
mkdir .ssh
cp documents/id* .ssh/
sudo chmod 600 .ssh/*
cd homeflow/attis
git pull
@Yatoom
Yatoom / setup.md
Last active January 23, 2025 23:17
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@alexellis
alexellis / k8s-pi.md
Last active December 13, 2024 23:24
K8s on Raspbian
@jiggneshhgohel
jiggneshhgohel / ssh_config.md
Last active September 8, 2022 00:28
Windows 10 Linux Subsystem SSH-agent issues
Host github.com-jiggneshhgohel
HostName github.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_work_gmail
AddKeysToAgent yes


Host csexperimental.abc.com