Skip to content

Instantly share code, notes, and snippets.

View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
ANSIBLE_PATH = '.' # path targeting Ansible directory (relative to Vagrantfile)
# Set Ansible roles_path relative to Ansible directory
ENV['ANSIBLE_ROLES_PATH'] = File.join(ANSIBLE_PATH, 'vendor', 'roles')
View group1.csv
Chris chris@example.com
Felix felix@example.net
Elizabeth lizzy1994@example.com
André andre@example.fr
Milo milo.milo@example.com
Olivia olive99@example.net
Hugo hugo124@example.net
Amit amit.123@example.com
Ludwig ludwig@example.net
Raoul raoul@example.com
View application.php
<?php
/**
* composer require sentry/sentry-sdk
*/
use Sentry;
Env::init();
// Bedrock application config...
if (env('SENTRY_DSN')) {
Sentry\init([
'dsn' => env('SENTRY_DSN'),
@swalkinshaw
swalkinshaw / gist:2695510
Created May 14, 2012
WordPress: Mandatory Excerpt
View gist:2695510
<?
function mandatory_excerpt($data) {
$excerpt = $data['post_excerpt'];
if (empty($excerpt)) {
if ($data['post_status'] === 'publish') {
add_filter('redirect_post_location', 'excerpt_error_message_redirect', '99');
}
View errors.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'graphql', '1.10.10'
end
class BaseArgument < GraphQL::Schema::Argument
def initialize(*args, **kwargs, &block)
super(*args, prepare: method(:convert_id), **kwargs, &block)
View wp-setup.php
<?php
if (!is_blog_installed()) { return; }
if ('http://' . $_SERVER['SERVER_NAME'] . '/wp' == get_option('home')) {
update_option('siteurl', 'http://' . $_SERVER['SERVER_NAME'] . '/wp');
update_option('home', 'http://' . $_SERVER['SERVER_NAME']);
update_option('upload_path', $_SERVER['DOCUMENT_ROOT'] . '/media');
update_option('upload_url_path', 'http://' . $_SERVER['SERVER_NAME'] . '/media');
update_option('permalink_structure', '/%postname%/');
}
View Capfile
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Custom tasks
require 'capistrano/composer'
require 'capistrano/npm'
View background.js
const WHITELIST = [
'https://cdn.theathletic.com'
]
const ALLOW = { cancel: false };
const DENY = { cancel: true };
chrome.webRequest.onBeforeSendHeaders.addListener((req) => {
var cancel = null;
@swalkinshaw
swalkinshaw / site.yml
Last active Jun 15, 2018
Multiple sites on one box with bedrock-ansible
View site.yml
# this is group_vars/development
---
www_root: /srv/www
# Define your WordPress sites here
wordpress_sites:
- site_name: site1.dev
site_hosts:
- site1.dev