Skip to content

Instantly share code, notes, and snippets.

Niall O'Brien niallobrien

  • Waterford, Ireland
Block or report user

Report or block niallobrien

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@niallobrien
niallobrien / Vagrantfile
Last active May 20, 2019
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 …
View Vagrantfile
# -*- 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"
View App.vue
<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 Oct 9, 2012
Laravel & Bootstrap ajax modal example
View gist:3859740
// 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 / App.js
Last active Apr 10, 2018
Simple Vue & Vuex fetch example using @feathersjs for realtime data.
View App.js
// App.js
<template>
<div id="app">
<Messages></Messages>
</div>
</template>
<script>
import Messages from './components/Messages'
import store from './vuex/store'
@niallobrien
niallobrien / webpack.mix.js
Last active Feb 26, 2018
Laravel Mix +TailwindCSS + PurgeCSS Asset Pipeline Config for AdonisJS
View webpack.mix.js
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
Laravel & Angular Asset Pipeline with Gulp
View README.md

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

View Messages.vue
<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 Jan 12, 2016
Laravel 4 install & update process
View gist:5098578
// 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 Jan 1, 2016
Install script for Laravel #php development. Node.js and Ruby included.
View Vagrantfile
# -*- 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"
View gist:7118965
A self-hosted backend platform for front-end developers to easily create sophisticated, realtime web applications.
Bonfire will be a node.js backend platform for developing a realtime API. It also provides common integrations that sophisticated realtime web applications require. Bonfire is being developed so that your typical front-end developer will rarely have to touch backend code.
How?
Bonfire will sit on top of Sails.js (node.js, Express & Socket.io) and will use MongoDB.
It will allow front-end developers to perform CRUD operations via websockets upon the backend data. Security restrictions will be written & enforced server-side. This will closely model Firebase in this regard.
What Else?
As a front-end developer, there’s only so much you can do before you will need your own backend (even when using something like Firebase). Since we will already have a backend running for you to deploy, we’ll also include common (opinionated) integrations and features common to most web apps (as discussed above). Su
You can’t perform that action at this time.