Skip to content

Instantly share code, notes, and snippets.

View jrjohnson's full-sized avatar
🐶
probably reading something

Jon Johnson jrjohnson

🐶
probably reading something
View GitHub Profile
@mareksuscak
mareksuscak / messenger.yaml
Created September 11, 2019 22:40
Symfony 4.4 Messenger - Alternative approach to different middleware for producer and consumer
framework:
messenger:
# ...
# Read more to learn why there are two buses (TL;DR: different middleware on each side - producer and consumer)
# https://github.com/symfony/symfony/issues/32436#issuecomment-530565499
default_bus: command.bus
buses:
command.bus:
@silasrm
silasrm / gist:3da655045b899a858eae4f4463755f5c
Last active January 31, 2023 16:03 — forked from maccath/gist:3981205
Split PDF to individual pages using FPDI and FPDF
<?php
/**
* Split PDF file
*
* <p>Split all of the pages from a larger PDF files into
* single-page PDF files.</p>
*
* @package FPDF required http://www.fpdf.org/
* @package FPDI required http://www.setasign.de/products/pdf-php-solutions/fpdi/
@stopfstedt
stopfstedt / ilios-cim.markdown
Last active August 29, 2015 14:02
ilios curriulum inventory managment brain dump.

Some Background

Q: What does it do?

It generates a report of curricular information for a given program in a given year.

Q: What does the report cover?

  • when it gets taught (program, year)
  • what gets taught (competencies/objectives)
#!/bin/bash
# Add Vagrant's NFS setup commands to sudoers, for `vagrant up` without a password
# Updated to work with Vagrant 1.3.x
# Stage updated sudoers in a temporary file for syntax checking
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
@Ocramius
Ocramius / User.php
Last active July 20, 2024 15:27
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
@GUI
GUI / install_vagrant_sudoers.sh
Created June 3, 2012 19:13 — forked from beddari/install_vagrant_sudoers.sh
Allow Vagrant sudo-access without password for NFS-setup (for OS X)
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports
@beddari
beddari / install_vagrant_sudoers.sh
Created December 13, 2011 12:47
Allow Vagrant sudo-access without password for NFS-setup
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
if [ -z "$1" ]; then
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp)
cat > $TMP <<EOF
Cmnd_Alias VAGRANT_EXPORTS_ADD = /bin/su root -c echo '*' >> /etc/exports
Cmnd_Alias VAGRANT_NFSD = /etc/init.d/nfs-kernel-server restart
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -e /*/ d -ibak /etc/exports