Skip to content

Instantly share code, notes, and snippets.

@rsanchez
rsanchez / eecli-planning.md
Last active March 16, 2022 08:43
eecli Planning

This is a document where contributors can plan and brainstorm ideas for eecli.

  • run act from
  • Not sure if it does this but for the GitHub adder make sure it installs third party modules to correct folders?
  • check for merge conflicts before pushing part of the deploy script reference: http://stackoverflow.com/questions/3065650/whats-the-simplest-way-to-git-a-list-of-conflicted-files
  • eecli deploy. Runs envoy or ansible whatever is specified. Pass in parameters, like -staging, or whatever. Other commands can go in eecli config file. Instead of running deploy tasks and calling eecli, run eecli deploy and call in
require 'formula'
class Sshpass < Formula
url 'http://downloads.sourceforge.net/project/sshpass/sshpass/1.05/sshpass-1.05.tar.gz'
homepage 'http://sshpass.sourceforge.net/'
md5 'c52d65fdee0712af6f77eb2b60974ac7'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
@rsanchez
rsanchez / config.php
Created August 28, 2014 14:41
Mailtrap w/ EE
<?php
$config['mail_protocol'] = 'smtp';
$config['smtp_server'] = 'mailtrap.io';
$config['smtp_username'] = 'YOUR_MAILTRAP_INBOX_USERNAME';
$config['smtp_password'] = 'YOUR_MAILTRAP_INBOX_PASSWORD';
$config['email_newline'] = "\r\n";
$config['email_crlf'] = "\r\n";
$config['email_smtp_port'] = TRUE;
$config['smtp_port'] = '2525';
@rsanchez
rsanchez / pi.my_addon.php
Created May 16, 2014 14:04
Using the EE PSR-4 autoloader
<?php
$plugin_info = array(
'pi_name' => 'My Addon',
'pi_version' => '1.0.0',
'pi_author' => 'Rob Sanchez',
'pi_author_url' => 'https://github.com/rsanchez',
'pi_description'=> '',
'pi_usage' => ''
);
@rsanchez
rsanchez / gist:9549396
Last active August 29, 2015 13:57
Deep + Resource Router
<?php
use rsanchez\Deep\Deep;
use rsanchez\Deep\App\Entries;
$config['resource_router'] = array(
'json' => function($router) {
Deep::bootEloquent(ee());
$entries = Entries::channel('blog')->limit(10)->get();
@rsanchez
rsanchez / attributes_to_array.php
Created November 27, 2013 16:03
attributes_to_array
/**
* Convert a string of attributes to an associative array
*
* @param string $attributes_string a string of XML/HTML attributes, ex. width="100" height="200"
* @return array ex. array('width' => '100', 'height' => '200')
*/
function attributes_to_array($attributes_string) {
$attributes = array();
// use simplexml to parse the attributes string
@rsanchez
rsanchez / vhost.sh
Last active December 26, 2018 03:57
Shell script to create MAMP PRO virtual host
vhost( ) {
if [[ -z $1 ]]; then
echo 'usage: vhost [hostname]'
return
fi
HOST=$1
HOSTNAME="$HOST.dev"
ADDRESS="127.0.0.1"
SITEPATH="$HOME/Sites/$HOST"
@rsanchez
rsanchez / gist:6553852
Created September 13, 2013 17:48
create a standalone clone of the EE db object (useful when doing nested active record calls)
$db = ee()->load->database(array(
'dbdriver' => 'mysql',
'conn_id' => ee()->db->conn_id,
'database' => ee()->db->database,
'dbprefix' => ee()->db->dbprefix,
), TRUE);
@rsanchez
rsanchez / wkhtmltopdf.rb
Created June 21, 2013 14:18
wkhtmltopdf 0.9.9 homebrew formula
require 'formula'
class Wkhtmltopdf < Formula
url 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9.tar.bz2'
homepage 'http://code.google.com/p/wkhtmltopdf/'
md5 'df2bb84b7d15140ca14732898155dd6a'
depends_on 'qt'
def install
@rsanchez
rsanchez / gist:4494530
Created January 9, 2013 16:27
diff two urls using FileMerge
curldiff( ) {
template="/tmp/curldiff-XXXXXXXX"
file1=$(mktemp $template)
file2=$(mktemp $template)
echo "Loading $1"
curl -# -L -o $file1 $1
echo "Loading $2"
curl -# -L -o $file2 $2
opendiff $file1 $file2
rm $file1 $file2