Skip to content

Instantly share code, notes, and snippets.

View ekandreas's full-sized avatar

Andreas Ek ekandreas

View GitHub Profile
<!-- file: views/index.blade.php -->
@controller
@ekandreas
ekandreas / controller-paths.txt
Created August 21, 2017 20:43
Paths for controllers and views
wp-content
└── themes
└── your_theme
├── style.css <- standard theme style.css, mandatory
├── index.php <- standard index theme, mandatory
├── views <- folder for Blade view templates
└── controllers <- folder for Blade controller classes
├── index.php <- the extended class to match index page hiearchy
├── single.php <- matches the request for single pages
└── page.php <- matches WordPress request for page hierarchy
@ekandreas
ekandreas / controllers-path-filter.php
Created August 21, 2017 20:18
Controllers Path Filter
add_filter('bladerunner/controller/paths', function ($paths) {
$paths[] = PLUGIN_DIR . '/my-fancy-plugin/controllers';
return $path;
});
@ekandreas
ekandreas / controllers-single.php
Last active August 21, 2017 20:16
Bladerunner 1.7 Controllers
<?php
// file: controllers/single.php
namespace App;
use Bladerunner\Controller;
class Single extends Controller
{
/**

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

/**
* Deployer pull task for reversed deployment of WordPress Bedrock
* PHP Deployer v5
*/
task('pull', function () {
$host = Context::get()->getHost();
$user = $host->getUser();
$hostname = $host->getHostname();
$localHostname = str_replace('.se', '.app', $hostname);

A. En banner som redigeras i WordPress har denna bildkälla: Bild A

http://www.skolporten.se/app/uploads/2016/01/La%CC%88rarnasTidn_banner600x120.jpg

B. När den skickas i nyhetsbrevet kommer den att ha följande format: Bild B

http://www.skolporten.se/app/uploads/2016/01/L%C3%A4rarnasTidn_banner600x120.jpg
@ekandreas
ekandreas / composer.json
Created February 3, 2016 09:56
Composer WordPress install declaration
{
"require": {
"johnpbloch/wordpress": "*",
"composer/installers": "*"
},
"extra": {
"wordpress-install-dir": "public",
"installer-paths": {
"public/wp-content/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"public/wp-content/plugins/{$name}/": ["type:wordpress-plugin"],
@ekandreas
ekandreas / single.php
Last active February 3, 2016 09:02
single.php
<?php
bladerunner('views.single');
@ekandreas
ekandreas / functions.php
Last active July 8, 2017 03:20
Block external WordPress API request
/**
* Block external WordPress API request
*/
function wp_api_block_request($pre, $args, $url)
{
if (strpos($url, 'api.wordpress.org')) {
return true;
} else {
return $pre;
}