Skip to content

Instantly share code, notes, and snippets.

@ijy
ijy / ext.store_discount.php
Created August 6, 2013 10:44 — forked from elivz/ext.store_discount.php
For Expresso Store v1. Every product added to the basket gets a $10 discount. In Store v2 this is now included natively.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Store Discount Extension
*
* @package ExpressionEngine
* @subpackage Addons
* @category Extension
* @author Eli Van Zoeren
* @link http://elivz.com

A Symphony Workflow

I'm describing my workflow in these articles, before I start my next Symphony project. Mostly for myself, to iron out my recurring problems, it is based on solid git techniques, taking heed of advice learned from Symphony community members, many many tips on the web, and flicking through the pages of O'Reilly's Version Control with git.

The core aim of this article, is to get a good Symphony development and deployment environment using git as the basis for the organisation, and have it written down for reference.

This workflow can be applied to any project, in theory, that has a starting point being a private remote git repo.

Disclaimer

There are many types of caching that will improve website performance. Here are just five:

MySQL query caching

Every read query that Symphony executes is cached by MySQL. It is important to understand that this is not the result of the query, but the SQL statement itself. MySQL retains a pool of these statements so that they are quicker to execute in the future. This is pretty standard, and you can use it in your own applications too by using SELECT SQL_CACHE for your read queries.

Object caching

Once the database has been queried, the results are used to build objects (pages, data sources, sections, field, entries etc.). These objects are alive only for the lifespan of each page, and are destroyed at the end of each request. Systems such as Wordpress allow these objects to be cached and persisted between each page request (using APC, Memcache, flat files or MySQL), thereby shared between all users. Symphony doesn't do this, but it really should.

Fragment caching

If you have one piece of a p

Function Shortcut
previous tab ⌘ + left arrow
next tab ⌘ + right arrow
go to tab ⌘ + number
go to window ⌘ + Option + Number
go to split pane by direction ⌘ + Option + arrow
go to split pane by order of use ⌘ + ] , ⌘ + [
split window horizontally (same profile) ⌘ + D
split window vertically (same profile) ⌘ + d
#!/bin/bash
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/libosxfuse_i32.la" \
"/usr/local/lib/libosxfuse_i64.la" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )
@ijy
ijy / app.js
Last active August 29, 2015 14:07 — forked from clineamb/app.js
/*
* Nunjucks + Express
* I couldn't find anything that helped me setup the enviornment
* correctly for these in the latest vesion of Express 4 (at the time
* of writing this).
*
* This Gist for those that want to keep using Nunjucks with Express 4.
* This also goes over working with a Nunjucks environment to use custom
* filters, extensions, etc.
*
@ijy
ijy / crontab_helper
Created August 17, 2016 14:53 — forked from khalwat/crontab_helper
Never struggle with editing your crontab again; put this in the beginning of each of your crontabs
# * * * * * command to execute
# ┬ ┬ ┬ ┬ ┬
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ └───── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names)
# │ │ │ └────────── month (1 - 12)
# │ │ └─────────────── day of month (1 - 31)
# │ └──────────────────── hour (0 - 23)
# └───────────────────────── min (0 - 59)
@ijy
ijy / ngrok-installation.md
Created November 26, 2017 10:57 — forked from wosephjeber/ngrok-installation.md
Installing ngrok on Mac

#Installing ngrok on OSX

  1. Download ngrok
  2. Unzip it to your Applications directory
  3. Create a symlink (instructions below)

Creating a symlink to ngrok

Run the following two commands in Terminal to create the symlink.

# cd into your local bin directory
@ijy
ijy / portal.md
Created November 26, 2017 10:58 — forked from glinton/portal.md
Portal as an SSL terminator for `nanobox run`

Download portal for your OS.

Create a config file for portal

config.json

{
 "db-connection": "scribble:///tmp/portal",
 "log-level": "info",
 "server": true,

>> "just-proxy": true

@ijy
ijy / ensure-cert-macos.sh
Created December 1, 2017 09:26 — forked from koop/ensure-cert-macos.sh
Ensures a certificate is in the macOS system keychain.
#!/bin/bash
# Usage
# $ ./install-cert-macos.sh "/path/to/cert"
CERT_PATH="$1"
# First, grab the SHA-1 from the provided SSL cert.
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g")
# Next, grab the SHA-1s of any standard.dev certs in the keychain.
# Don't return an error code if nothing is found.