Skip to content

Instantly share code, notes, and snippets.

@smccracken
smccracken / button-subscriber-count.js
Last active April 14, 2024 16:04
Fetch subscriber count from buttondown email API
// fetch buttondown newsletter subscriber count from API at build time
// common file location src/_data/newsletter.js
module.exports = async function() {
let subscribers;
try {
const response = await fetch(
`https://api.buttondown.email/v1/subscribers`,
{
@smccracken
smccracken / DBD::MySQL Error
Created January 27, 2011 20:36
DBD::MySQL Error on OSX v10.6.6
t/00base....................NOK 2/6# Tried to use 'DBD::mysql'.
# Error: Can't load '/Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.16.dylib
# Referenced from: /Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle
# Reason: image not found at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207.
# at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 9
@smccracken
smccracken / Makefile.PL
Created January 27, 2011 20:35
My Makefile.PL output for building DBD::MySQL
I will use the following settings for compiling and testing:
cflags (mysql_config ) = -I/usr/local/mysql/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64
embedded (mysql_config ) =
libs (mysql_config ) = -L/usr/local/mysql/lib -lmysqlclient -lpthread
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
@smccracken
smccracken / MySQL Setup
Created January 27, 2011 20:35
My MySQL version and config for reference
iMac:~ swm$ mysql --version
mysql Ver 14.14 Distrib 5.5.8, for osx10.6 (i386) using readline 5.1
iMac:~ swm$ which mysql_config
/usr/local/mysql/bin/mysql_config
iMac:~ swm$ mysql_config
Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/mysql/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64]
@smccracken
smccracken / MySQL Setup
Created January 27, 2011 20:33
The version and config of my current MySQL setup
iMac:~ swm$ mysql --version
mysql Ver 14.14 Distrib 5.5.8, for osx10.6 (i386) using readline 5.1
iMac:~ swm$ which mysql_config
/usr/local/mysql/bin/mysql_config
iMac:~ swm$ mysql_config
Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/mysql/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64]