Skip to content

Instantly share code, notes, and snippets.

View garyblankenship's full-sized avatar
🎩
I may be slow to respond.

Gary Blankenship garyblankenship

🎩
I may be slow to respond.
View GitHub Profile
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
$results = DB::select("
SELECT zipcode, city, state, lat, lng, distance_in_mi
FROM (
SELECT zipcode, city, state, lat, lng, r,
(
3963.17
* ACOS( COS( RADIANS( latpoint ) )
* COS( RADIANS( lat ) )
* COS( RADIANS( longpoint ) - RADIANS( lng ) )
+ SIN( RADIANS( latpoint ) )
@garyblankenship
garyblankenship / Experimental_Generation_of_Interpersonal_Closeness.md
Last active August 30, 2025 18:09 — forked from shmup/Experimental_Generation_of_Interpersonal_Closeness.md
The Science of Instant Intimacy: How 36 Questions Reveal Human Connection #psychology #relationships #consciousness

The Science of Instant Intimacy: How 36 Questions Reveal the Hidden Architecture of Human Connection

What if creating deep human connection was as systematic as following a recipe—and what does that tell us about the nature of consciousness itself?


Love Isn't Magic—It's Engineering

The most groundbreaking study in relationship psychology proved something radical: intimacy can be manufactured. Arthur Aron's research didn't just create connections between strangers—it revealed that what we call "chemistry" is actually a systematic progression of mutual vulnerability.

@garyblankenship
garyblankenship / default
Created June 13, 2020 15:46 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@garyblankenship
garyblankenship / Envoy.blade.php
Created August 9, 2020 16:43 — forked from freekmurze/Envoy.blade.php
Multi server zero downtime Envoy script
@setup
require __DIR__.'/vendor/autoload.php';
(new \Dotenv\Dotenv(__DIR__, '.env'))->load();
$appName = "my-app.com";
$repository = "spatie/{$appName}";
$baseDir = "/home/forge/{$appName}";
$releasesDir = "{$baseDir}/releases";
$currentDir = "{$baseDir}/current";
$newReleaseName = date('Ymd-His');
@garyblankenship
garyblankenship / sometimes.php
Last active July 30, 2025 05:23
run the closure sometimes, a percentage of the time
<?php
if (!function_exists('sometimes')) {
/**
* Executes a callback a given percentage of the time.
*
* @param int $percentage The percentage of times the callback should run (0-100).
* @param callable $callback The closure to execute.
* @param mixed|callable|null $default The value to return if the callback is not executed.
* If it's a Closure, it will be invoked.
@garyblankenship
garyblankenship / app.js
Created June 3, 2022 17:08
Tangocrypto NFT API Example
const axios = require('axios').default;
const HOST = 'cardano-testnet.tangocrypto.com';
const APP_ID = '34492bb302cf4678a3a0ec93029c5bh67';
const API_KEY = '8888c8026e7i47b4b2527151e126e914';
axios.defaults.baseURL = `https://${HOST}/${APP_ID}/v1`;
axios.defaults.headers.common['x-api-key'] = API_KEY;
axios.defaults.headers.post['Content-Type'] = 'application/json';
@garyblankenship
garyblankenship / cardano.sh
Created September 6, 2022 21:36 — forked from feamcor/cardano.sh
Script for common actions on Cardano node and CLI
#!/usr/bin/env bash
#set -x
export CARDANO_HOME="${CARDANO_HOME:-${HOME}/cardano}"
if [ ! -d "${CARDANO_HOME}" ]; then
printf 'ERROR :: envar CARDANO_HOME directory does not exist: %s' "${CARDANO_HOME}"
exit 1
fi
export CARDANO_NODE_HOME="${CARDANO_NODE_HOME:-${CARDANO_HOME}/cardano-node}"
@garyblankenship
garyblankenship / burn.sh
Created September 9, 2022 20:27 — forked from ahaxu/burn.sh
cardano burn token bash script
# Usage:
# $ ./burn.sh $tokenName $payment_address $policy_script_file_path
#
# For eg:
# $ ./burn.sh AhaXuTokenName `cat payment.addr` policy.script
#
# For list of token (for eg token.list) as below
# AAA
# BBB
# CCC
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then