Skip to content

Instantly share code, notes, and snippets.

View mdunbavan's full-sized avatar

Mark Dunbavan mdunbavan

View GitHub Profile
Markmacbook168:build mdunbavan$ npm install gulp-sass --save-dev
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> node-sass@0.9.6 install /Freelance/projects/valeriewade/build/node_modules/gulp-sass/node_modules/node-sass
> node build.js
(node:86110) DeprecationWarning: child_process: options.customFds option is deprecated. Use options.stdio instead.
CXX(target) Release/obj.target/binding/binding.o
@mdunbavan
mdunbavan / craft-localization-nginx
Created September 21, 2016 15:17 — forked from cmalven/craft-localization-nginx
nginx config for Craft CMS localization
server {
listen 80;
server_name site.production.designcompany.com;
root /home/forge/site.production.designcompany.com/public;
# enable gzip compression
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript image/svg+xml text/xml text/css;
@mdunbavan
mdunbavan / PostController.php
Created September 1, 2015 09:31
object and array data
<?php
foreach(Post::all() as $postObject){
$start_time = $postObject['post_create_time'];
$end_time = $postObject['post_ended_time'];
$postData =
array(
'post' => 'title',
'start_time' => $start_time,
'end_time' => $end_time
@mdunbavan
mdunbavan / OffersController.php
Last active August 29, 2015 14:27
Query chains
<?php
/**
* Show all offers queries by current date
*
* Get a JSON representation of all the offers.
* @Get("/")
* @Versions({"v1"})
*/
public function getOffers(Offer $offer)
<?php
//include the class you created
use App\Navigation
public function index(Navigation, $navigation)
{
// location var to use in the blade template
$nav = Navigation;
//compact the nav for use in views which passes it through
return view('your.view', compact('nav'));
@mdunbavan
mdunbavan / OffersController.php
Created July 28, 2015 16:03
Image upload in controller
$path = str_replace("/home/vagrant/projects/scoff/scoff-api/public", "", public_path('images/offers'));
Image::make($file->getRealPath())
->resize(600, 600)
->save(public_path('images/offers').$filename);
$data['image'] = $path.$filename;
@mdunbavan
mdunbavan / Offer.php
Created July 24, 2015 11:59
Laravel updates
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Offer extends Model
{
/**
* The database table used by the model.
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Offer extends Model
{
/**
* The database table used by the model.
@mdunbavan
mdunbavan / Homestead.yaml
Created July 13, 2015 16:56
Homestead config file
folders:
- map: /Freelance/scoff-api/scoff-api
to: /Freelance/scoff-api/scoff-api
sites:
- map: scoff_api.local
to: /Freelance/scoff-api/scoff-api/public
databases:
- homestead
[
{
"ID": 4434,
"title": "new brand case",
"status": "publish",
"type": "case-studies",
"author": {},
"content": "<p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Maecenas sed diam eget risus varius blandit sit amet non magna.</p>\n",
"parent": null,
"link": "http://wmh.dev/case-studies/new-brand-case/",