Skip to content

Instantly share code, notes, and snippets.

View bubba-h57's full-sized avatar

Bubba bubba-h57

View GitHub Profile
@bubba-h57
bubba-h57 / install.md
Last active September 28, 2024 23:32
Instructions for installing PHP Extensions sqlsrv & pdo_sqlsrv on Apple M1 ARM64 workstations.

PHP Extensions sqlsrv & pdo_sqlsrv on Apple M1 ARM64

Install brew

If you do not already have it, install brew as follows:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install the GNU make tools

brew install autoconf automake libtool
@jszobody
jszobody / Undies.php
Last active February 12, 2022 15:59
Get/set any class private property
<?php
/**
* Access/modify any instance private property.
*/
class Undies {
protected $instance;
protected $setter;
protected $getter;
#!/bin/sh
# Script to compile vips from git for AWS lambda as dynamic binary
# Run on a fresh amzn-ami-hvm-2015.09.1.x86_64-gp2 image.
# Tested with image id ami-bff32ccc on t2.micro in eu-west-1.
set -e # abort on errors
# set -x # for debugging
echo Installing build dependencies...
@BenjaminAdams
BenjaminAdams / creditCard.sql
Last active March 1, 2022 19:04
Search a SQL server field for a creditcard number
SET ROWCOUNT 10000
SELECT SomeField
FROM tablename
WHERE patindex('%[3|4|5|6][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%',SomeField) > 0
or to get the unique numbers
SET ROWCOUNT 50
SELECT distinct SUBSTRING (SomeField ,patindex('%[3|4|5|6][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%',SomeField) , 12 )