Skip to content

Instantly share code, notes, and snippets.

View doublecompile's full-sized avatar

Jonathan Hawk doublecompile

View GitHub Profile
@doublecompile
doublecompile / .projenrc.ts
Last active January 3, 2024 14:34
TypeScript, Jest, ECMAScript Modules, and Projen
import { typescript, javascript } from "projen";
const project = new typescript.TypeScriptProject({
name: "template-typescript-esm",
defaultReleaseBranch: "main",
projenrcTs: true,
devDeps: ["@jest/globals"],
minNodeVersion: "18.0.0",
@doublecompile
doublecompile / projen-bundle-esm.ts
Created September 5, 2023 20:57
projen-bundle-esm.ts
// How to use esbuild with Projen to output an ESM library.
const { bundleTask, outfile } = project.bundler.addBundle("./src/handler.mts", {
target: "node18",
platform: "node",
watchTask: false,
});
const [{ exec: bundleCommand = "" }] = bundleTask.steps;
@doublecompile
doublecompile / stack.ts
Created September 29, 2022 14:22
AWS CDK Stack for CrossAccountZoneDelegationRecord access
import { Construct } from "constructs";
import { Stack, StackProps, CfnOutput } from "aws-cdk-lib";
import {
IRole,
Role,
PolicyStatement,
AnyPrincipal,
ManagedPolicy,
Effect,
PrincipalWithConditions,
@doublecompile
doublecompile / td-agent.conf
Last active April 10, 2022 07:18
Fluentd configuration for nginx, PHP-FPM, and syslog forwarding to AWS CloudWatch Logs
## This configuration file expects certain environment variables to be available.
## You can add them to /etc/default/td-agent:
## AWS_REGION
## AWS_VPC_ID
## AWS_INSTANCE_ID
<source>
@type syslog
port 42185
bind 127.0.0.1
tag rsyslog
@doublecompile
doublecompile / search-everything.patch
Created August 22, 2018 20:04
Fixes Search Everything problem
diff --git a/wp-content/plugins/search-everything/search-everything.php b/wp-content/plugins/search-everything/search-everything.php
index d39281c5..a3fa4d63 100644
--- a/wp-content/plugins/search-everything/search-everything.php
+++ b/wp-content/plugins/search-everything/search-everything.php
@@ -275,7 +275,8 @@ class SearchEverything {
$searchQuery .= $this->se_search_authors();
}
- if ( $searchQuery != '' ) {
+ $searchQuery = trim($searchQuery);
@doublecompile
doublecompile / php.ini
Last active January 16, 2018 21:20
Typical PHP FPM ini
[PHP]
engine = On
short_open_tag = Off
output_buffering = Off
zlib.output_compression = Off
default_charset = "UTF-8"
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority
zend.enable_gc = On
max_execution_time = 240
memory_limit = 128M
@doublecompile
doublecompile / setup.sh
Last active April 18, 2017 19:33
Setup my dotfiles
#!/bin/sh
if [ -n "$(command -v yum)" ]; then
sudo yum -y install git
elif [ -n "$(command -v apt-get)" ]; then
sudo apt-get update
sudo apt-get install -y git stow
fi
pwd=$(pwd)
git clone https://github.com/doublecompile/dotfiles.git ~/dotfiles
rm ~/.bashrc
@doublecompile
doublecompile / rotate-wallpaper.sh
Last active April 11, 2017 14:21
Rotates a wallpaper on either Gnome or OS X
#!/bin/bash
# Rotate wallpapers on GNOME or OSX
# (OSX users need to install coreutils)
set -e
WALLPAPERS="$HOME/wallpaper"
if [[ -n "$(command -v gsettings)" ]]; then
paper=`find $WALLPAPERS -type f | shuf -n 1`
PID=$(pgrep gnome-session)
@doublecompile
doublecompile / install-composer.sh
Created October 16, 2016 20:38
Installs Composer
#!/bin/sh
EXPECTED_SIGNATURE=$(wget https://composer.github.io/installer.sig -O - -q)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$EXPECTED_SIGNATURE" = "$ACTUAL_SIGNATURE" ]
then
php composer-setup.php --quiet
RESULT=$?
@doublecompile
doublecompile / php.ini
Created July 29, 2016 22:50
Typical PHP CLI ini
[PHP]
engine = On
short_open_tag = Off
zlib.output_compression = Off
max_execution_time = 120
max_input_time = 120
memory_limit = -1
default_charset = "UTF-8"
error_reporting = E_ALL
display_errors = On