Craig R Morton crmpicco
- Rockingham, WA, Australia
- Sign in to view email
- http://www.crmpicco.co.uk
View zshrc.sh
alias ll='ls -lG' | |
export EDITOR=$(which vim) | |
# Highlight the current autocomplete option | |
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" | |
# Better SSH/Rsync/SCP Autocomplete | |
zstyle ':completion:*:(scp|rsync):*' tag-order ' hosts:-ipaddr:ip\ address hosts:-host:host files' | |
zstyle ':completion:*:(ssh|scp|ftp|sftp):*' hosts $hosts | |
zstyle ':completion:*:(ssh|scp|ftp|sftp):*' users $users |
View Permissions
ps aux | grep httpd | |
_www 60997 0.0 0.0 4300784 476 ?? S 4:49pm 0:00.00 /usr/local/opt/httpd/bin/httpd -k start | |
_www 60996 0.0 0.0 4300784 456 ?? S 4:49pm 0:00.00 /usr/local/opt/httpd/bin/httpd -k start | |
_www 60995 0.0 0.0 4300784 456 ?? S 4:49pm 0:00.00 /usr/local/opt/httpd/bin/httpd -k start | |
_www 60994 0.0 0.0 4300784 456 ?? S 4:49pm 0:00.00 /usr/local/opt/httpd/bin/httpd -k start | |
root 26130 0.0 0.0 4300808 2032 ?? Ss 2:08pm 0:00.77 /usr/local/opt/httpd/bin/httpd -k start | |
crmpicco 76683 0.0 0.0 4268040 788 s001 S+ 5:00pm 0:00.00 grep httpd | |
_www 60998 0.0 0.0 4300784 456 ?? S 4:49pm 0:00.00 /usr/local/opt/httpd/bin/httpd -k start | |
View bootstrap_3_layout.html.twig
{% block form_errors -%} | |
{% if errors|length > 0 -%} | |
{% if form is not rootform %}<span class="help-block">{% else %}<div class="alert alert-danger">{% endif %} | |
<ul class="list-unstyled"> | |
{%- for error in errors -%} | |
<li><span class="glyphicon glyphicon-exclamation-sign"></span> {{ error.message }}</li> | |
{%- endfor -%} | |
</ul> | |
{% if form is not rootform %}</span>{% else %}</div>{% endif %} | |
{%- endif %} |
View braintree-paypal-loggedin.html
<div id="braintree-paypal-loggedin" | |
style=' | |
display: block; | |
max-width: 500px; | |
overflow: hidden; | |
padding: 16px; | |
background-image: url("https://checkout.paypal.com/pwpp/2.15.7/images/paypal-small.svg"), none; | |
background-position: 20px 50%; background-repeat: no-repeat; | |
background-size: 13px 15px; | |
border-top: 1px solid rgb(209, 212, 214); |
View braintree-paypal-api-v3-hide-pp.js
'use strict'; | |
var paypalButton = document.getElementById('paypal'); | |
var paypalEmail = document.getElementById('bt-pp-email'); | |
var paypalCancel = document.getElementById('braintree-paypal-loggedin'); | |
function displayPrettyPayPal(payload) { | |
paypalEmail.innerHTML = payload.details.email; | |
$('#braintree-paypal-loggedin').fadeIn('slow'); | |
} |
View getBraintreeSubscriptions.php
/** | |
* | |
* @param string $filepath | |
* @return array | |
*/ | |
private function getBraintreeSubscriptions(string $filepath) : array | |
{ | |
// open the exported Braintree CSV file | |
$subscriptions = []; | |
if (false !== ($handle = fopen($filepath, 'r'))) { |
View SubscriptionDaysPastDue.php
$subscriptionRenewalDate = \DateTime::createFromFormat('Y-m-d H:i:s', date('Y-m-d H:i:s', $subscription->currentTermEnd)); | |
$now = new \DateTime('now'); | |
$daysPastDue = $now->diff($subscriptionRenewalDate)->format('%a'); |
View ga_event_to_multiplue_trackers.js
if ("ga" in window) { | |
// we have multiple trackers, one for region and one for global, so we need to iterate over each | |
// tracker and send the event data to each | |
trackers = ga.getAll(); | |
$.each(trackers, function(i, tracker) { | |
if (tracker) { | |
tracker.send('event', category, action, label); | |
} | |
}); | |
} |
View isoCodeToCountry.php
function isoCodeToCountry($code) | |
{ | |
$code = strtoupper($code); | |
$countryList = array( | |
'AF' => 'Afghanistan', | |
'AX' => 'Aland Islands', | |
'AL' => 'Albania', | |
'DZ' => 'Algeria', | |
'AS' => 'American Samoa', |
View PdoExceptionListener.php
<?php | |
/** | |
* An exception listener to pickup PDOExceptions thrown in the codebase. | |
* | |
* @author Craig R Morton <crmpicco@aol.com> | |
* @date 22-07-2016 | |
*/ | |
namespace AppBundle\EventListener; |
NewerOlder