- Links (internal, external)
- Heading (h1-h6)
- Ordered Lists (ol)
- Unordered Lists (ul)
- Aligned Images (left, right, center)
- Bold (strong)
- Italic (em)
- Underline (underline)
- Address (address)
- Blockquote (blockquote)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function($) { | |
/** | |
* Prints single div content. Adds a class to the body of 'js-print' for | |
* targeting specific styles. | |
* | |
* @return void | |
*/ | |
$.fn.printDiv = function() { | |
var printContents = $(this).html(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Setup vars for pagination. | |
$per_page = 10; | |
$current_page = ( intval( get_query_var('paged') ) ) ? intval( get_query_var( 'paged' ) ) : 1; | |
$offset = $per_page * ($current_page - 1); | |
// Config, subsitute / add whatever you need. Leave per_page and offset as the vars. | |
$sweet_args = [ | |
'numberposts' => $per_page, | |
'post_type' => 'post', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns the ID of a YouTube Video URL | |
* | |
* This works with both the short and full URL. | |
* | |
* @param string $url The video URL | |
* @return string The video ID | |
* @author TJ Miller http://tjay.co |
I hereby claim:
- I am sixlive on github.
- I am sixlive (https://keybase.io/sixlive) on keybase.
- I have a public key whose fingerprint is 584F E70F 15E5 4E38 28DD FC52 7371 D9F8 90BE 6170
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root /app/public | |
tls /app/_docker/caddy/server.crt /app/_docker/caddy/server.key | |
fastcgi / php:9000 php | |
errors visible | |
rewrite { | |
regexp .* | |
ext / | |
to /index.php?{query} | |
} |
When I build an API I typically use a pretty simple format. It is actually pretty much Fractal out of the box by way of Spatie's Larave Fractal package. Personally, I've found other formats more verbose than I need. I've built some pretty robust APIs using this format without issue. I also rely heavily on sending status codes for request status and consumer notification.
When building an app that consumes the API I typically build SDKs. I've been using Apiary to document my APIs and you get a pretty nice tool set from them, making SDK generation and testing so much easier.
The responses were built using the following code:
routes/api.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
published: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
published: true |
OlderNewer