Skip to content

Instantly share code, notes, and snippets.

@Soben
Soben / README.md
Created October 21, 2023 03:31
Cassidoo | isIsomorphic String

Solution to Cassidoo's Week of October 15, 2023 Challenge

Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if there is a one-to-one mapping possible for every character of the first string to every character of the second string.

My initial version would ignore any non-alphanumeric characters.

That said, this definitely does not handle accents, etc.

@Soben
Soben / README.md
Last active August 22, 2023 18:08
Cassidoo | Guessing Game

Solution to Cassidoo's Week of Aug 21, 2023 Challenge

Make a "guessing game" where there is a target number, and as the user makes guesses, the output returns higher or lower until the user is correct.

I haven't messed with PHP's CLI handling of user input in a while, so I decided to stay focused on my language of 'choice'.

Went a little above the basic request, allowing users to override the min/max range. Available commands

$ php guessing-game.php
@Soben
Soben / main.js
Created August 18, 2023 20:10
Can someone explain how sass is compiling here??
import $ from "jquery";
import '../scss/main.scss';
// jQuery HoverIntent
import hoverintent from 'hoverintent';
window.hoverintent = hoverintent
// Alpine JS
import Alpine from 'alpinejs'
@Soben
Soben / README.md
Last active August 14, 2023 13:53
Cassidoo | Faulty Keyboard

Solution to Cassidoo's Week of Aug 14, 2023 Challenge

You have a faulty keyboard. Whenever you type a vowel on it (a,e,i,o,u,y), it reverses the string that you have written, instead of typing the character. Typing other characters works as expected. Given a string, return what will be on the screen after typing with your faulty keyboard.

@Soben
Soben / README.md
Created August 2, 2023 23:53
Cassidoo | isAnagram

Solution to Cassidoo's Week of July 31, 2023 Challenge

Given two strings s and t, return true if t is an anagram of s, and false otherwise. Try this in a language you're not comfortable with!

Realized there were a couple edge cases, like with anagrams involving differences in several words, but are still valid. Adjusted accordingly.

Never wrote anything in Python before, but besides being able to look up equivalent php functions in python, it was thankfully pretty one-to-one conversion.

@Soben
Soben / Dockerfile
Last active February 28, 2023 03:08
fly.io Barebones Apache Configuration for Slim PHP
FROM php:8.2-apache
# Install `zip` -- required for composer
RUN apt update \
&& apt install -y zip libzip-dev \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip
# Install Apache rewrite module
RUN a2enmod rewrite
@Soben
Soben / columnFinder.php
Last active August 14, 2023 13:44
Cassidoo | Sheet Column lookup to get true column number from letter structure.
<?php
/*
Solving Cassidoo's coding problem from the newsletter sent February 6th.
Co-Pilot assisted *sigh*
I was on track to solve the problem, but co-pilot immediately spurted out the `pow`
function before I had a chance to figure out the math. I'm not sure if I'm happy or
annoyed. Co-Pilot is also helping me type this message out :|
@Soben
Soben / passthrough.js
Last active October 12, 2022 20:53
GET Query Passthrough Handling
/**
* Querystring Passthrough
* Allows UTM values to stickaround on the site until needed.
*/
{
const allowedPassthrough = [
"utm_medium",
"utm_source",
"utm_campaign",
"utm_content",
@Soben
Soben / docker-compose.yml
Created February 18, 2020 20:12
Simple Docker Wordpress
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 8080:80
environment:
@Soben
Soben / keybase.md
Created February 1, 2020 18:21
keybase.md

Keybase proof

I hereby claim:

  • I am soben on github.
  • I am soben (https://keybase.io/soben) on keybase.
  • I have a public key ASASBe_e67tjizGUVNwQcshXjLQ1p_mPEHQ8CispX9x23Qo

To claim this, I am signing this object: