Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Gooding J5Dev

  • Yorkshire, United Kingdom
View GitHub Profile
@J5Dev
J5Dev / ParseInputStream.php
Last active Jun 3, 2019 — forked from devmycloud/ParseInputStream.php
Process php://input to get multipart/form-data parameters for PATCH API request
View ParseInputStream.php
<?php
namespace App\Services;
use Illuminate\Support\Facades\Log;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* stream - Handle raw input stream
*
@J5Dev
J5Dev / .env
Created Jan 17, 2019
Good git ignore for laravel
View .env
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vagrant
/.composer
Homestead.json
Homestead.yaml
@J5Dev
J5Dev / Deploy project error
Created Aug 8, 2018
Forge Custom VPS setup issues 2
View Deploy project error
Cloning into 'forge-test.j5dev.co.uk'...
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
/home/forge/.forge/provision-20157059.sh: line 28: composer: command not found
View Public - Forge Custom VPS Output
root@rec5ba001t:~# wget -O forge.sh "https://forge.laravel.com/servers/<SERVER_ID>/vps?forge_token=<FORGE_TOKEN>"; bash forge.sh
--2018-08-07 16:24:36-- https://forge.laravel.com/servers/222164/vps?forge_token=<FORGE_TOKEN>
Resolving forge.laravel.com (forge.laravel.com)... 104.25.9.32, 104.25.8.32, 2400:cb00:2048:1::6819:920, ...
Connecting to forge.laravel.com (forge.laravel.com)|104.25.9.32|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'forge.sh'
forge.sh [ <=> ] 11.77K --.-KB/s in 0s
@J5Dev
J5Dev / .gitattributes
Created Jan 10, 2018
Unity Git Settings
View .gitattributes
# Auto detect text files and perform LF normalization
* text=auto
# 3D models
*.3dm filter=lfs diff=lfs merge=lfs -text
*.3ds filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
*.c4d filter=lfs diff=lfs merge=lfs -text
*.collada filter=lfs diff=lfs merge=lfs -text
*.dae filter=lfs diff=lfs merge=lfs -text
@J5Dev
J5Dev / Foundation.Animated.Acordian.js
Created Jul 17, 2014
Animated Accordion for Zurbs Foundation Acordian
View Foundation.Animated.Acordian.js
$(function() {
$(".accordion").on("click", "dd", function () {
$("dd.active").find(".content").slideUp("slow");
if (!$(this).hasClass("active")) {
$(this).find(".content").slideToggle("slow");
}
});
});
@J5Dev
J5Dev / jQuery.footerSticker.js
Created Jul 16, 2014
jQueryFooterSticker - Works on browser resize without any css markup required
View jQuery.footerSticker.js
$(window).resize(function () {
var footer = $("footer");
var pos = footer.position();
var height = $(window).height();
height = height - pos.top;
height = height - footer.outerHeight();
if (height > 0) {
footer.css({
'margin-top': height + 'px'
});
@J5Dev
J5Dev / gulpfile.js
Last active Aug 29, 2015
Gulp files to process all sass & js files then compress them. used within Laravel app with admin-site separation using Zurb Foundation
View gulpfile.js
var gulp = require('gulp');
var gutil = require('gulp-util');
var autoprefixer = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var phpunit = require('gulp-phpunit');
var concat = require('gulp-concat');
@J5Dev
J5Dev / NavLinkMacro.php
Last active Aug 29, 2015
Laravel 4 HTML macro to generate link within a list from a string or route, including active status if current url
View NavLinkMacro.php
<?php
HTML::macro('navLink', function ($route, $text, $listAttributes = [], $linkAttributes = [], $params = null, $secure = null)
{
# Set default attributes
$listDefaults = ['class' => ''];
$linkDefaults = ['class' => ''];
// Merge default attributes with those supplied
$listAttributes = $listDefaults + ($listAttributes == null ? [] : $listAttributes);
@J5Dev
J5Dev / BaseModel.php
Last active Aug 29, 2015
Laravel Base model for use with model based validation, compensating for Unique on update
View BaseModel.php
<?php
use Eloquent, Validator;
/**
* Class BaseModel
*
* @package
*/
class BaseModel extends Eloquent {