Skip to content

Instantly share code, notes, and snippets.

@khatriafaz
khatriafaz / laravel-permissions.sh
Last active April 10, 2021 18:51
Laravel server file permissions
#!/bin/bash
# Default variables
apachename="${1:-apache}"
username="${2:-$USER}"
folder="${3:-.}"
# Change ownership to webserver user/group
chown -R $apachename:$apachename $folder

You can register the mixin class in the register method of a Laravel service provider:

use Illuminate\Foundation\Testing\TestResponse;

TestResponse::mixin(TestResponseMixin::class);
@echr
echr / app.js
Last active November 23, 2023 12:05
Simple Laravel + Vue + Laravel Mix + Firebase Notification (PWA, Offline)
// FILE PATH: /resources/js/app.js
require('./bootstrap');
// Import Service Worker Registry
require('./extensions/sw-registry');
import Vue from 'vue';
...
@loilo
loilo / pass-slots.md
Last active March 27, 2024 20:58
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@jeffochoa
jeffochoa / Errors.js
Last active February 9, 2022 09:52
Vue Form and Error validator (Laracasts)
class Errors {
/**
* Create a new Errors instance.
*/
constructor() {
this.errors = {};
}
/**

Running Xhgui With Tideways Through a Docker Container

Run Xhgui Docker Container

cd ~
git clone https://github.com/perftools/xhgui.git
docker run --name xhgui -d -p 8880:80 -P -v "$HOME/xhgui":/var/www/xhgui clarencep/xhgui
docker exec xhgui bash -c 'cd /var/www/xhgui && \
    curl --silent https://raw.githubusercontent.com/composer/getcomposer.org/master/web/installer | php -- --quiet && \
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@mathiasverraes
mathiasverraes / TestFrameworkInATweet.php
Last active May 23, 2022 12:28
A unit testing framework in a tweet.
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
@blackfalcon
blackfalcon / git-feature-workflow.md
Last active April 13, 2024 07:33
Git basics - a general workflow

Git-workflow vs feature branching

When working with Git, there are two prevailing workflows are Git workflow and feature branches. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited, and the focus of this article.

If you are new to Git and Git-workflows, I suggest reading the atlassian.com Git Workflow article in addition to this as there is more detail there than presented here.

I admit, using Bash in the command line with the standard configuration leaves a bit to be desired when it comes to awareness of state. A tool that I suggest using follows these instructions on setting up GIT Bash autocompletion. This tool will assist you to better visualize the state of a branc

@mretzak
mretzak / index.html
Created March 19, 2013 20:21
A CodePen by mretzak. Off-Canvas With Twitter Bootstrap - The following is a general example of how to get Twitter bootstrap to have an off-canvas layout. To tryout simply begin shrinking your browser.
<div class="container" id="main">
<div class="row-fluid" style="
margin-bottom: 10px;">
<p class="span12">
<a href="#menu" class="side-menu-link btn btn-mini" title="Click for sub-menu">
<i class="icon-th"></i>
</a>
</p>
</div>