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
<template> | |
<section class="search-results" v-show="results.length > 0"> | |
<div v-for="result in results" class="search-result"> | |
<a :href="'/' + result.slug">{{ result.title }}</a> | |
</div> | |
</section> | |
</template> |
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 | |
public function getImageSizeKeepAspectRatio( $imageUrl, $maxWidth, $maxHeight) | |
{ | |
$imageDimensions = getimagesize($imageUrl); | |
$imageWidth = $imageDimensions[0]; | |
$imageHeight = $imageDimensions[1]; | |
$imageSize['width'] = $imageWidth; |
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
#!/bin/bash | |
git diff --cached --name-only | while read FILE; do | |
if [[ "$FILE" =~ ^.+(php|inc|module|install|test)$ ]]; then | |
echo "Running tests..." | |
cd "${0%/*}/.." | |
phpunit 1> /dev/null | |
if [ $? -ne 0 ]; then | |
echo -e "\e[1;31m\tUnit tests failed ! Aborting commit.\e[0m" >&2 | |
exit 1; |
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
public function boot() | |
{ | |
Queue::failing(function (JobFailed $event) use ($slackUrl) { | |
Notification::route('slack', $slackUrl)->notify(new SlackFailedJob($event)); | |
}); | |
} |
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 | |
namespace CustomCast; | |
use Carbon\Carbon; | |
use Illuminate\Contracts\Database\Eloquent\CastsAttributes; | |
class UtcDateTime implements CastsAttributes | |
{ | |
/** |
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 | |
$request = "request=string of request"; | |
// Send using curl | |
$ch = curl_init(); | |
curl_setopt( $ch, CURLOPT_URL, $url); // URL to post | |
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); // return into a variable | |
curl_setopt( $ch, CURLOPT_HTTPHEADER, $header ); // headers from above | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_PORT, 8080); |
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
/** | |
* Continents and Countries MySQL Tables compiled from Wikipedia, Braintree Payments documentation | |
* and a couple other places I don't recall at the moment. This data is compatible with the Braintree | |
* Payment API as of Dec 2011 | |
* | |
* Compiled by Steve Kamerman, 2011 | |
*/ | |
SET FOREIGN_KEY_CHECKS=0; | |
-- ---------------------------- |
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
find . -name "node_modules" -exec rm -rf '{}' + |
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
version: '3.3' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
environment: | |
MYSQL_ROOT_PASSWORD: somewordpress | |
MYSQL_DATABASE: wordpress |
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
"require": { | |
// Exact version to 1.5.4 | |
"vendor/package": "1.5.4", | |
// Greater or lower bounds | |
"vendor/package": ">=1.5.0", // Anything above 1.5.0 | |
"vendor/package": "<1.5.0", // Anything below 1.5.0 | |
// Wildcard | |
"vendor/package": "1.5.*", // >=1.5 <1.6 |