Skip to content

Instantly share code, notes, and snippets.

jmather / Sentry_Exception.cls
Created Aug 8, 2019
Custom Apex Exceptions with stack traces!
View Sentry_Exception.cls
* Created by Jacob Mather <> on 2019-06-25.
global with sharing class Sentry_Exception extends Exception {
global Map<String, Object> context = new Map<String, Object>();
private List<String> stackTrace;
global void setStackTrace(List<String> lines) {
stackTrace = lines;
View jenkins-setup-credentials.groovy
import jenkins.model.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import hudson.plugins.sshslaves.*;
domain =
store = Jenkins.instance.getExtensionList('com.cloudbees.plugins.credentials.SystemCredentialsProvider')[0].getStore()

Keybase proof

I hereby claim:

  • I am jmather on github.
  • I am thejmather ( on keybase.
  • I have a public key whose fingerprint is 398D AEDD 8EA9 DC5A 1F2B 4E1B 8494 4ADB 482B B934

To claim this, I am signing this object:

jmather / composer.json
Last active Dec 26, 2015
Example composer.json with satis repo and packagist disabled.
View composer.json
"repositories": [
"type": "composer",
"url": ""
"packagist": false
jmather / .bashrc
Last active Dec 24, 2015
My work in progress bash profile to make the git repos nicer to work with...
View .bashrc
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
MAGENTA=$(tput setaf 9)
ORANGE=$(tput setaf 172)
GREEN=$(tput setaf 190)
PURPLE=$(tput setaf 141)
WHITE=$(tput setaf 256)
MAGENTA=$(tput setaf 5)
jmather / MediaServerFilter.php
Created Jan 21, 2013
Media/CDN server w/ Symfony1
View MediaServerFilter.php
class MediaServerFilter extends sfFilter
public function execute($filterChain)
// Execute this filter only once
if ($this->isFirstCall() && sfConfig::get('app_media_filter_disable', false) == false) {
// Filters don't have direct access to the request and user objects.
View LoadWebsiteSpecificData.php
namespace Demo\Bundle\WebsiteBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Application\Sonata\UserBundle\Entity\User;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
jmather /
Created Jan 9, 2013
Latest vagrant provision script
NFSUID=`stat -c %u /vagrant/`
/usr/bin/sudo su -c "cat /etc/passwd | grep -v vagrant:x: > /etc/"
/usr/bin/sudo su -c "echo \"vagrant:x:${NFSUID}:502::/home/vagrant:/bin/bash\" >> /etc/"
/usr/bin/sudo su -c "chown -R ${NFSUID}:vagrant /home/vagrant"
/usr/bin/sudo su -c "mv -f /etc/ /etc/passwd"
/usr/bin/sudo su -c "chown -R vagrant:vagrant /var/lib/php/session"
/usr/bin/sudo su -c "chown vagrant:vagrant /tmp/vagrant-*"
jmather /
Last active May 6, 2018
This is in my project's bin/ which is looked for (and ran) by my custom vagrant
cp -f app/config/parameters.dist.yml app/config/parameters.yml
rm -rf app/cache/*
php app/console doctrine:database:create
php app/console doctrine:migrations:migrate --no-interaction
yes | php app/console doctrine:fixtures:load
php app/console cache:clear
php app/console assetic:dump
php app/console assets:install --symlink
View MeetingBlock.php
namespace My\Bundle\BlockBundle\Block;
use Symfony\Component\HttpFoundation\Response;
use Sonata\BlockBundle\Model\BlockInterface;
use Sonata\BlockBundle\Block\BaseBlockService;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Validator\ErrorElement;