Skip to content

Instantly share code, notes, and snippets.

View xthexder's full-sized avatar

Jacob Wirth xthexder

View GitHub Profile
@xthexder
xthexder / life.py
Last active March 25, 2023 05:34
Conway's Game of Life Simulation - Generated by ChatGPT (GPT-3.5)
import argparse
import numpy as np
import time
# Define the initial states as strings
INITIAL_STATES = {
"glider": ".X\n"
"..X\n"
"XXX",
@xthexder
xthexder / $HOME\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Last active December 19, 2021 22:32
PowerShell profile configuration for history search via up/down arrow keys.
Import-Module PSReadLine
Import-Module posh-git
Set-PSReadLineOption -HistoryNoDuplicates:$True
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
# Revert posh-git prompt to default
function prompt {
@xthexder
xthexder / gist:44f4b9cec3ed7876780d
Created April 15, 2015 11:09
frustra/bbcode [list] Tag Implementation
// Note: Use of this list tag implementation requires that `autoCloseTags` be set to true.
// Example use:
// [list]
// [*] Item 1
// [*] Item 2
// [/list]
compiler.SetTag("list", func(node *bbcode.BBCodeNode) (*bbcode.HTMLTag, bool) {
out := bbcode.NewHTMLTag("")
@xthexder
xthexder / session.go
Last active August 29, 2015 13:56
Revel SessionFilter for storing sessions in redis. Adds a config option for setting and verifying CSRF tokens.
package app
import (
"crypto/rand"
"encoding/hex"
"fmt"
"net/http"
"strings"
"time"
@xthexder
xthexder / ShopifyMultipass.php
Last active May 22, 2022 11:16
ShopifyMultipass - Ported to PHP
<?php
date_default_timezone_set("UTC");
class ShopifyMultipass {
private $encryption_key;
private $signature_key;
public function __construct($multipass_secret) {
// Use the Multipass secret to derive two cryptographic keys,
// one for encryption, one for signing