Skip to content

Instantly share code, notes, and snippets.

@fdob
fdob / error.php
Created November 20, 2012 15:58 — forked from pedroresende/error
Stack Trace Error
<?php
$content = $this->api->getContentToUpdate(
$this->api->getContentInfoByPath( '/Date-and-Time-Test-Object' )
);
try {
$newData = new DateTime( '31-09-2012 12:00 am' ); // 31-09-2012 12:00 am
$content->setField( 'date_time', $newData );
@fdob
fdob / composer.json
Created February 15, 2013 15:57
Apply a fix/patch after deploying & running composer.
{
// . . .
"scripts": {
"post-install-cmd": [
// NOTE: cwd is the location of the composer.json
// -t/--batch (supress interactivity)
"patch -t -p0 < path/to/file.patch"
]
}
// . . .
@fdob
fdob / gist:5983637
Last active November 30, 2022 01:14
in-diff: Use inotify to capture changes to a file, and output diffs to STDOUT. Needs inotify-tools.
#!/bin/bash
# hook into inotify to watch a file, and generate
# diffs for changes in real-time
#
# requires inotify-tools (apt-get install inotify-tools)
#
# @author Filipe Dobreira <[email protected]>
usage() {
echo "Usage:"
echo " in-diff <file>|help"