Skip to content

Instantly share code, notes, and snippets.

View Fed0t's full-sized avatar

Fedot Serghei Fed0t

View GitHub Profile
@jsphpl
jsphpl / NPerGroup.php
Last active May 26, 2020 06:09 — forked from tureki/BaseModel.php
laravel-pgsql-n-related-models-per-parent-with-scopes
<?php
namespace App\Models\Traits;
use DB;
/**
* This trait is to work around a problem where a limit on an Eloquent
* relation by default applies to all queried models in total.
*
@larzconwell
larzconwell / gist:2870863
Created June 4, 2012 21:08
Convert pdf to text and read it out loud
#!/bin/bash
if [[ "$1" != "" ]]; then
pdf_file="$1"
shift
rm /tmp/pdf_file.txt >> /dev/null 2>&1
if [[ ! -f $(which pdftotext) ]]; then
echo "You do not have xpdf installed, please install it to convert pdfs to text..."
exit 1