Skip to content

Instantly share code, notes, and snippets.

View tmarsteel's full-sized avatar

Tobias Marstaller tmarsteel

View GitHub Profile
@tmarsteel
tmarsteel / deploy.php
Created September 17, 2017 15:37
PHP Script for pull deployment from git scm
#!/usr/bin/php5.5-cli
<?php
/**
This script checks out a commit from a git-repository into a directory revision/$hash within the context
directory. Then creates the symbolic links defined in $links within that directory and swiches the symbolic
link $CURRENT_DEPLOYMENT_POINTER_LINK to that new directory.
*/
@tmarsteel
tmarsteel / TransactionQueue.js
Last active July 1, 2017 11:32
A Promises/A+ based transactional Queue
var TransactionQueue = function() {
var items = [],
currentTransactionPromise = null,
queuedDuringTransaction = [],
_self = this;
this.pushItem = function(item) {
if (currentTransactionPromise != null)
{
console.log("Adding item WITHIN transaction: %o", item);