Skip to content

Instantly share code, notes, and snippets.

@adamwathan
adamwathan / belongs-to-many.sublime-snippet
Last active October 19, 2020 16:59
Eloquent Relationship snippets for Sublime Text
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}::class, {$2:table});
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>belt</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
@pascalbaljet
pascalbaljet / imagick-3.4.0-PHP7-forge.sh
Last active November 26, 2020 09:10
Install Imagick 3.4.0 on PHP 7.0 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.0.tgz
tar xvzf imagick-3.4.0.tgz
@abrudtkuhl
abrudtkuhl / comments.php
Created August 8, 2012 18:05
WordPress comments.php for Responsive Facebook Comments
<div class="fb-comments"data-href="<?php the_permalink(); ?>" data-num-posts="2" mobile="false"></div>
@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name