Skip to content

Instantly share code, notes, and snippets.

@paulredmond
paulredmond / docker-compose.yml
Created September 18, 2017 05:13
A Docker Compose file for an example Laravel project
version: '3'
services:
app:
build:
context: .
dockerfile: .docker/Dockerfile
image: laravel-docker
ports:
- 8080:80
volumes:
@braian87b
braian87b / image-builder-openwrt-lede.sh
Last active February 20, 2024 03:01
Image-Builder Procedure for OpenWRT - LEDE
# ------------------------------------------------------------------------
# Image-Builder Procedure for OpenWRT - LEDE (In this case using Debian x64 NetInstall virtual machine)
# ------------------------------------------------------------------------
su
apt-get update # Optional, make and upgrade too in case it has too many old pakackes.
apt-get install make aria2 screen ncftp -y
screen -
cd ~
@tompec
tompec / bulma.blade.php
Last active September 10, 2020 20:33
Bulma blade template for Laravel 5.4 pagination
@if ($paginator->hasPages())
<nav class="pagination is-centered">
@if ($paginator->onFirstPage())
<a class="pagination-previous" disabled>Previous</a>
@else
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="pagination-previous">Previous</a>
@endif
@if ($paginator->hasMorePages())
<a class="pagination-next" href="{{ $paginator->nextPageUrl() }}" rel="next">Next</a>
@kbond
kbond / ExampleTest.php
Last active March 16, 2023 11:44
Laravel Dusk in a non-laravel (Symfony) app
<?php
namespace App\Tests\Browser;
use App\Tests\HasDuskBrowser;
class ExampleTest extends \PHPUnit_Framework_TestCase
{
use HasDuskBrowser;
@tacone
tacone / tinymce.js
Created June 23, 2016 10:53
TinyMce with file upload
$(function () {
var editorCount = 0;
$('.richtext').each(function () {
var sendFile = function (callback) {
data = new FormData();
data.append("file", fileInput[0].files[0]);
$.ajax({
url: "/upload/image",
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@samstoller
samstoller / 01-walkthrough.md
Last active October 18, 2018 06:32
How to use wp-cli with a non-standard wp-config.php location

You are running a customized WordPress install where your configurations are NOT located in one of the two required locations (outside the webroot for example) and are receving the following error when running wp-cli commands:

Error: Strange wp-config.php file: wp-settings.php is not loaded directly.

###Solution Simply move the require_once ... wp-settings.php line from the actual configuration file to the end of file that is requiring/including it. See below for examples.

This works by tricking the wp-cli regex into correctly parsing the configuration files.

@michaeldyrynda
michaeldyrynda / Envoy.blade.php
Last active July 13, 2023 17:40
Laravel 5 Envoy deploy configuration
@servers([ 'remote' => 'server.example.com', ])
@setup
if ( ! isset($repo) )
{
throw new Exception('--repo must be specified');
}
if ( ! isset($base_dir) )
{
@zofe
zofe / routes.php
Last active August 29, 2015 14:07
Internal router for rapyd-laravel that match "uri" and/or "query string", it can run before Laravel to Fire widget events
<?php namespace Zofe\Rapyd;
/**
* Class Router
* the rapyd router, works "before" laravel router to check uri/query string
* it set widgets status / actions.
*
* @package Zofe\Rapyd
*
* @method public static get($uri=null, $query=null, Array $route)