Skip to content

Instantly share code, notes, and snippets.

@crot4lus
crot4lus / wordpress-install.sh
Last active February 2, 2017 16:47
Script used to install Bedrock (WordPress), FoundationPress and plugins...
#!/bin/bash
echo "Running this script will help setup and obtain resources for your new WordPress website."
read -p "Do you wish to proceed with setup? (Y/N)" CONF_PROCEED
if [ "$CONF_PROCEED" == "Y" ] || [ "$CONF_PROCEED" == "y" ]; then
read -p "Which directory would you like us to install WordPress into?: " INSTALL_DIRECTORY
mkdir -p "$INSTALL_DIRECTORY"
echo "Copying Bedrock in to: $INSTALL_DIRECTORY"
composer create-project roots/bedrock "$INSTALL_DIRECTORY"
@crot4lus
crot4lus / UK Bank Holidays.csv
Created November 14, 2016 08:40
CSV with MySQL friendly UK bank holidays
Name Bank Holiday Date
New Year's Day 1 2009-01-01
Robert Burns Night (Burns Night) 0 2009-01-25
Holocaust Memorial Day 0 2009-01-27
Valentines Day 0 2009-02-14
Shrove Tuesday (Pancake Day) 0 2009-02-24
Ash Wednesday 0 2009-02-25
St David's Day 0 2009-03-01
St Patricks Day 0 2009-03-17
Mothering Sunday (Mothers Day) 0 2009-03-22
@crot4lus
crot4lus / deploy.php
Created June 24, 2016 07:47 — forked from krisnoble/deploy.php
A slightly modified version of Brandon Summers' script. For more information: http://simianstudios.com/blog/post/using-bitbucket-for-automated-deployment-of-multiple-repositories
<?php
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php
/**
* The root directory where the repos live.
*
* @var string
*/
$root_dir = '/your/root/dir/';
@crot4lus
crot4lus / gist:42b147b8e52d3c94f758
Created June 25, 2015 10:36
Cake belongsToMany
Array
(
[id] => 1
[name] => Super Admin
[permissions] => Array
(
[_ids] => Array
(
[0] => 7
[1] => 6
<?php
namespace App\Log\Engine;
use Cake\Log\Engine\BaseLog;
use Cake\ORM\TableRegistry;
class DataLog extends BaseLog
{
public function __construct(array $config = [])
<?php
$baseDir = dirname(dirname(__FILE__));
return [
'plugins' => [
'Bake' => $baseDir . '/vendor/cakephp/bake/',
'DebugKit' => $baseDir . '/vendor/cakephp/debug_kit/',
'Migrations' => $baseDir . '/vendor/cakephp/migrations/'
]
];
@crot4lus
crot4lus / custom-definitions-brackets.css
Last active August 29, 2015 14:08
Theme custom definitions - brackets
/* LINE PADDING */
.CodeMirror pre{
padding: 3px 0;
line-height: 24px;
}
.CodeMirror-linenumber{
padding: 3px 10px 3px 0;
line-height: 24px;
Array
(
[0] => Cake\ORM\Association\BelongsTo Object
(
[_name:protected] => UserLevels
[_className:protected] =>
[_foreignKey:protected] =>
[_conditions:protected] => Array
(
)
<table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
<h1 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; box-sizing: border-box; font-size: 32px; color: #fff; line-height: 1.2; font-weight: 500; margin: 40px 0 0; padding: 0;">$33.98 Paid</h1>
</td>
</tr>
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica N
@crot4lus
crot4lus / facebook-to-disqus.php
Created September 11, 2014 09:21
Import Facebook comments to Disqus
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dsq="http://www.disqus.com/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.0/"
>
<channel>
<?php
error_reporting(0);