Skip to content

Instantly share code, notes, and snippets.

View niallobrien's full-sized avatar

Niall O'Brien niallobrien

  • Waterford, Ireland
View GitHub Profile
{
"plugins": [
"react",
"prettier"
],
"extends": [
"airbnb",
"react-app",
"prettier"
],
@niallobrien
niallobrien / App.js
Last active May 14, 2020 21:05
Simple Vue & Vuex fetch example using @feathersjs for realtime data.
// App.js
<template>
<div id="app">
<Messages></Messages>
</div>
</template>
<script>
import Messages from './components/Messages'
import store from './vuex/store'
@niallobrien
niallobrien / Vagrantfile
Last active March 1, 2020 01:16
My full-stack Laravel Vagrant setup. It installs LAMP with Composer, PHPUnit, Ruby & node.js. Copy these three files to your Laravel project directory and run 'vagrant up'. Once complete, run 'vagrant ssh', cd to the /vagrant/ directory and run 'bash post-install.sh'. During the post install, you'll be asked for info regarding your package.json …
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
<template>
<div id="app">
<img class="logo" src="./assets/logo.png">
<Hello></Hello>
<Messages></Messages>
</div>
</template>
<script>
import Hello from './components/Hello'
@niallobrien
niallobrien / gist:3859740
Created October 9, 2012 16:03
Laravel & Bootstrap ajax modal example
// html
<div>This is my post</div>
<!-- Just put this div at the bottom of your template somewhere-->
<!-- Notice that its hidden by default, so if it doesnt get used, thats fine-->
<div class="modal hide"></div>
//JS
$.ajax({
type: 'post', // or post?
@niallobrien
niallobrien / webpack.mix.js
Last active February 26, 2018 01:11
Laravel Mix +TailwindCSS + PurgeCSS Asset Pipeline Config for AdonisJS
var mix = require('laravel-mix');
var glob = require("glob-all");
var PurgecssPlugin = require("purgecss-webpack-plugin");
isProduction = (process.env.NODE_ENV === 'production' || process.argv.includes('-p'));
class TailwindExtractor {
static extract(content) {
return content.match(/[A-z0-9-:\/]+/g);
}
@niallobrien
niallobrien / README.md
Last active May 2, 2016 11:57
Laravel & Angular Asset Pipeline with Gulp

Laravel & Angular

Overview

This setup involves creating a Laravel API and an Angular client-app with Gulp covering the asset pipeline.

Our Laravel API server will serve one view only and that is to simply load the Angular app.

First, create a new directory for your project. We're going to place the server and client directories in here. You'll need to install Laravel, Yeoman, generator-gulp-angular and any other dependencies.

Server

<template>
<div>
<input type="text" placeholder="Enter message" v-model="newMessage">
<button type="submit" @click="tryAddMessage">Add message</button>
<ul>
<li v-for="message in messages">
<span>{{ message.text }}</span>
<span @click="tryRemoveMessage(message)">x</span>
</li>
</ul>
@niallobrien
niallobrien / gist:5098578
Last active January 12, 2016 01:46
Laravel 4 install & update process
// Clone L4 repo
git clone -b develop git://github.com/laravel/laravel.git myapp
cd myapp
// Install Composer
curl -sS https://getcomposer.org/installer | php
php composer.phar install
// Rename origin
git remote rename origin upstream
@niallobrien
niallobrien / Vagrantfile
Last active January 1, 2016 14:38
Install script for Laravel #php development. Node.js and Ruby included.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"