Skip to content

Instantly share code, notes, and snippets.

@ijy
ijy / simple-server.txt
Last active December 19, 2015 02:39 — forked from JeffreyWay/gist:1525217
Instant Server for Current Directory.
alias server='open http://localhost:8000 && python -m SimpleHTTPServer'
@ijy
ijy / jquery-pubsub.js
Created June 28, 2013 14:19
jQuery PubSub in three lines. This will work in IE9+, so it's a perfect choice for jQuery 2.0 projects.
var o = $({});
$.subscribe = o.on.bind(o);
$.publish = o.trigger.bind(o);
@ijy
ijy / ssl-setup.sh
Created July 16, 2013 08:00 — forked from leevigraham/ssl-setup.sh
A shell script to setup SSL on your localhost.
mkdir ~/Desktop/ssl
cd ~/Desktop/ssl
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
sudo cp server.crt /private/etc/apache2/server.crt
sudo cp server.key /private/etc/apache2/server.key
@ijy
ijy / jquery-validate-match.js
Created July 17, 2013 11:29
Match two fields with the jQuery Validate plugin and the equalTo method.
$('#myform').validate({
rules: {
email: 'required',
emailConfirm: {
equalTo: '#email'
}
}
});
@ijy
ijy / xhtml-to-markdown.xsl
Created July 21, 2013 14:29
XHTML to Markdown converter.
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- XHTML-to-Markdown converter by Andrew Green, Article Seven, http://www.article7.co.uk/ -->
<!-- This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. -->
<xsl:stylesheet version='1.0' xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='text' encoding='utf-8'/>
@ijy
ijy / cartesian-product.js
Last active April 23, 2022 15:54
Underscore.js implementation of Cartesian Product (without any mutable variable). @see: http://stackoverflow.com/questions/12303989/cartesian-product-of-multiple-arrays-in-javascript
function cartesianProductOf() {
return _.reduce(arguments, function(a, b) {
return _.flatten(_.map(a, function(x) {
return _.map(b, function(y) {
return x.concat([y]);
});
}), true);
}, [ [] ]);
};
@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
@ijy
ijy / ext.store_discount_batch.php
Created August 6, 2013 10:52
For Expresso Store v1. Add a $10 discount for every item in the cart which for three or more items. 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 Ian Young
* @link http://

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

@ijy
ijy / symphony-2.3x-htaccess
Created August 22, 2013 16:55
Symphony 2.3x .htaccess file
### Symphony 2.3.x ###
Options +FollowSymlinks -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
### SECURITY - Protect crucial files
RewriteRule ^manifest/(.*)$ - [F]