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
@chabala
chabala / using-google-takeout.md
Last active April 19, 2025 08:33
Merge and extract tgz files from Google Takeout

Recently found some clowny gist was the top result for 'google takeout multiple tgz', where it was using two bash scripts to extract all the tgz files and then merge them together. Don't do that. Use brace expansion, cat the TGZs, and extract:

$ cat takeout-20201023T123551Z-{001..011}.tgz | tar xzivf -

You don't even need to use brace expansion. Globbing will order the files numerically:

$ cat takeout-20201023T123551Z-*.tgz | tar xzivf -
@vasanthk
vasanthk / System Design.md
Last active April 19, 2025 20:36
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 [email protected]: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