Skip to content

Instantly share code, notes, and snippets.

View tobyl's full-sized avatar
Coffee good.

Toby Leftly tobyl

Coffee good.
View GitHub Profile
@tobyl
tobyl / Trellis setup
Last active June 29, 2019 09:22
Bash script to setup Bedrock, Trellis and Sage
#!/bin/bash
# set this variable - it will be used as both the root folder name and the theme name for sage
# no spaces - should not be a URL - I'm using 'my-site' or similar
SITENAME="your-site-name"
# Add BitBucket username/password to have a remote repo setup
BBUSER="YOUR-BB-USERNAME"
BBPASS="YOUR-BB-PASSWORD"
@tobyl
tobyl / salt-cloud-salt.md
Last active August 29, 2015 14:27
Simple steps to get up and running with Salt-Cloud and a simple Salt example at Digital Ocean.

SaltStack & Salt-Cloud

SaltStack (or Salt) is the tool that sends instructions and provisioning data from the 'salt-master', or the master server, to it's 'minions', or slave servers.

Salt-Cloud is the tool that allows you to automatically setup and provision the Salt software to cloud servers, such as Amazon or DigitalOcean. Salt-Cloud also automated the process of adding minions and the authentication and acceptance of keys on the master. Salt-Cloud is installed as part of Salt now, except on some RHEL systems (Fedora, CentOS) where Salt and Salt-Cloud are two separate installs.

By default everything is installed in:

/etc/salt

{
"name": "simple-wp-boilerplate/simple-wp-boilerplate",
"description": "simple wordpress boilerplate setup via composer",
"license": "proprietary",
"repositories": [
{
"type": "composer",
"url": "http://wpackagist.org"
}
],
<?php
require __DIR__ . '/../phpdotenv/src/Dotenv.php';
require __DIR__ . '/../phpdotenv/src/Loader.php';
require __DIR__ . '/../phpdotenv/src/Validator.php';
$dotenv = new Dotenv\Dotenv( dirname( __DIR__ ) );
$dotenv->load();
$dotenv->required( array( 'DB_NAME', 'DB_USER', 'DB_PASSWORD', 'DB_HOST', 'WP_ENV', 'WP_HOME', 'WP_SITEURL' ) );
<?php
/**
*
* @package WordPress
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
Traceback (most recent call last)
File "/data/virtualenv/iris/lib/python2.7/site-packages/raven/middleware.py", line 35, in __call__
iterable = self.application(environ, start_response)
File "/data/virtualenv/iris/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 187, in __call__
response = self.get_response(request)
File "/data/virtualenv/iris/lib/python2.7/site-packages/django/core/handlers/base.py", line 199, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/data/virtualenv/iris/lib/python2.7/site-packages/django/core/handlers/base.py", line 236, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/data/virtualenv/iris/lib/python2.7/site-packages/django_extensions/management/technical_response.py", line 5, in null_technical_500_response
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
@tobyl
tobyl / api
Created August 25, 2016 23:06
const auth = {
login(payload) {
const email = payload.get('email');
const password = payload.get('password');
return fetch('/api/auth/jwt/token/', {
method: 'POST',
headers: {
body {
margin: 20px 0 0 0;
}
@media (min-width: 768px) {
body {
margin: 0 20px 0 20px;
}
}
<div>
<p>
<a href="#">link</a>
</p>
</div>
Compared to: