Skip to content

Instantly share code, notes, and snippets.

View rsoury's full-sized avatar
🍓
Foraging Berries

Ryan Soury rsoury

🍓
Foraging Berries
View GitHub Profile
@thewraven
thewraven / nestedArray.go
Last active July 18, 2018 14:07
Updating a nested field into an array using r.Branch
package main
import (
"fmt"
r "gopkg.in/dancannon/gorethink.v3"
)
type Commentary struct {
From string `gorethink:"from"`
@adamjohnson
adamjohnson / preferences.sublime-settings
Last active November 26, 2019 20:06
Exclude folder from search in Sublime Text. Helpful if you want to have the folder show up on the left, but don't want Sublime to search it when doing a "Find in Files" / project-wide search.
{
"binary_file_patterns": ["node_modules/*", "bower_components/*"]
}
@og24715
og24715 / httpProxyWithApiGateway.md
Last active January 10, 2020 00:07
Setting an HTTP Proxy on API Gateway by using Serverless framework.

HTTP オールスループロキシーを serverless で定義する

service: httpAllThroughProxy

provider:
  name: aws
  runtime: nodejs6.10

  stage: dev
@wpscholar
wpscholar / functions.php
Last active March 1, 2021 13:26
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@sumitpore
sumitpore / Commands.txt
Created April 4, 2020 09:09
Installing pcov extension on MacOS to be used with Local by Flywheel
git clone https://github.com/krakjoe/pcov.git
cd pcov
/usr/local/bin/phpize
./configure
export INCLUDE_PATH=/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-7.3.5+3/bin/darwin/include
make CPPFLAGS="-I${INCLUDE_PATH}/php -I${INCLUDE_PATH}/php/main -I${INCLUDE_PATH}/php/TSRM -I${INCLUDE_PATH}/php/Zend -I${INCLUDE_PATH}/php/ext -I${INCLUDE_PATH}/php/ext/date/lib"
sudo make install
sudo cp $(php-config --extension-dir)/pcov.so /usr/local/php/extensions
@lukecav
lukecav / wp-config.php
Last active December 30, 2021 09:25
iThemes Security Pro plugin constants that can be defined in a sites wp-config.php file
define(‘ITSEC_USE_CRON’, true);
define('ITSEC_DISABLE_MODULES', true);
define('ITSEC_DISABLE_TWO_FACTOR', true);
define('ITSEC_DISABLE_INACTIVE_USER_CHECK', true);
define(‘ITSEC_DEBUG’, true);
@cdimascio
cdimascio / Configure awscli
Last active January 20, 2023 04:05
IBM Cloud Object Storage COS with AWS CLI
cat ~/.aws/config
[default]
region = us-standard
output = json
@strarsis
strarsis / guide.md
Last active February 19, 2023 00:29
Object caching with Bedrock (and Trellis) using Redis

Object caching with Bedrock (and Trellis) using Redis

What is object caching

While nginx microcaching already solves page caching (as of static, rarely changing WordPress pages), the performance for dynamically generated pages (like WooCommerce shop pages and admin backend in general) can benefit greatly from additionally using an object cache. Object caching allows an application (in this case WordPress with its plugins, theme, etc.) to store prepared objects (mostly database queries) in a database and quickly retrieve them, therefore improving the performance of dynamic page generation. Object caching is (usually) transparent, which means that it shouldn't be noticeable by users and developers (except for the performance improvements of course).

Implementations

@blofeldthefish
blofeldthefish / White label Route 53 nameservers.md
Created August 23, 2018 19:42
AWS Route 53 white label nameserver setup
@hijonathan
hijonathan / form.html
Last active August 1, 2023 19:14
Submit a HubSpot form with AJAX without redirecting the user.
<form class='form-inline' id='my-custom-form'>
<div class="form-group">
<input type='email' class='form-control' placeholder='Your email address' required>
</div>
<button class="btn btn-primary" type='submit'>Sign up</button>
</form>
<!-- Actual form that gets submitted to HubSpot -->
<div class="hidden" id='hubspot-form'>
<script charset="utf-8" src="//js.hsforms.net/forms/current.js"></script>