Skip to content

Instantly share code, notes, and snippets.

View amacneil's full-sized avatar
💜
Foxglove Studio

Adrian Macneil amacneil

💜
Foxglove Studio
View GitHub Profile
@vasanthk
vasanthk / System Design.md
Last active June 29, 2024 19:22
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
{
"options": {
"config_plugin": "filesystem",
"logger_plugin": "filesystem",
"host_identifier": "hostname",
"event_pubsub_expiry": "86000",
"debug": "false",
"verbose_debug": "false",
"worker_threads": "4",
"schedule_splay_percent": 10
@jamierumbelow
jamierumbelow / composer.json
Created November 19, 2012 19:50
Installing PHPUnit via Composer
{
"require": {
"phpunit/phpunit": "3.7.*"
}
}
@Denham
Denham / AusPost shipping costs - wines
Created November 12, 2012 23:49
Base template for Auspost shipping costs
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Custom Store Shipping plugin
*
* Built based on AusPost costs for shipping wines.
* The actual rates change based on where the wines are being sent from, but you can use the zone stuff.
* The costs in this example are for shipping from Adelaide.
*/
class Store_shipping_aus_post_wines extends Store_shipping_driver
@billhorsman
billhorsman / circle.yml
Created September 2, 2012 22:35
Circle CI Config for deployment to Heroku with 10 min timeout
deployment:
staging:
branch: master
commands:
- git push git@heroku.com:yakify-ci.git:
timeout: 600
dependencies:
pre:
@elivz
elivz / ext.store_discount.php
Created July 22, 2012 20:27
Exp:resso Store discount extension
<?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
@oodavid
oodavid / README.md
Created March 26, 2012 17:05
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@elivz
elivz / stripe_jquery.js
Created January 8, 2012 03:28
Stripe integration code
$(document).ready(function() {
// Load the Stripe script
$.getScript('https://js.stripe.com/v1/', function() {
Stripe.setPublishableKey('pk_MoKd7A4QHY6s7OJBXUghBQQN3uCT2');
$('#checkout').show();
});
var $form = $("form[name='checkout']").submit(function(event) {
// Disable the submit button to prevent repeated clicks
$('.submit').attr("disabled", true);
@leshill
leshill / Procfile
Created November 28, 2011 20:01
Unicorn config for cedar stack on Heroku.
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
@airways
airways / mod.extendedchannel.php
Created October 28, 2011 15:52
ExpressionEngine: Extending a core or third party module or plugin
<?php
class ExtendedChannel {
public __construct()
{
$this->EE = &get_instance();
}
public function extended_entries()
{