Skip to content

Instantly share code, notes, and snippets.

@jasonbouffard
jasonbouffard / gist:7474108
Created November 14, 2013 20:52
PHP Lint Recursive for Jenkins
#!/bin/sh
EXITCODE=0;
for file in `find . -path ./vendor -prune -o -name "*.php"`
do
RESULTS=`php -l $file`
if [ "$RESULTS" != "No syntax errors detected in $file" ]
then
EXITCODE=1;
@jasonbouffard
jasonbouffard / clipboard-to-dropbox
Last active December 20, 2015 22:29
Takes your current clipboard/pasteboard and pastes it to a text file in a public Dropbox directory. Shortens the url and puts it in your clipboard for quick pasting into a IM/Email.
#!/bin/bash
DATE=$(date +"%Y-%m-%d");
TIME=$(date +"%I.%M.%S");
AMPM=$(date +"%p");
FILENAME=Paste\ $DATE\ at\ $TIME\ $AMPM.txt;
# You can export you DROPBOX_USER_ID in your .bash_profile
# or hardcode it here by replacing YOURDROPBOXUSERID
DB_USER_ID=${DROPBOX_USER_ID-YOURDROPBOXUSERID};
@jasonbouffard
jasonbouffard / screenshot-to-dropbox
Last active September 26, 2015 06:07
OSX Bash script to snap an interactive screenshot into your Dropbox public folder and copy the public url to your clipboard.
#!/bin/bash
DATE=$(date +"%Y-%m-%d");
TIME=$(date +"%I.%M.%S");
AMPM=$(date +"%p");
FILENAME=Screen\ shot\ $DATE\ at\ $TIME\ $AMPM.png;
# You can export you DROPBOX_USER_ID in your .profile
# or hardcode it here by replacing YOURDROPBOXUSERID
DB_USER_ID=${DROPBOX_USER_ID-YOURDROPBOXUSERID};
@jasonbouffard
jasonbouffard / DateTimeTimeZone.php
Created June 16, 2011 16:46
Timezone on User Document in UserBundle Twig Extension
<?php
// Acme/DemoBundle/Twig/Extension/DateTimeTimeZone.php
namespace Acme\DemoBundle\Twig\Extension;
use Symfony\Component\Security\Core\SecurityContext;
use Acme\DemoBundle\Document\User as User;
class DateTimeTimeZone extends \Twig_Extension
@jasonbouffard
jasonbouffard / backupTask.class.php
Created February 9, 2010 01:20
backupTask provides a method to dump your database to Amazon's S3 for a symfony application
<?php
/**
* backupTask provides a method to dump your database to Amazon's S3 for a symfony application.
* The S3 php class used: http://undesigned.org.za/2007/10/22/amazon-s3-php-class
*
* @author Jason Bouffard
*/
class backupTask extends sfBaseTask