Skip to content

Instantly share code, notes, and snippets.

View ericlbarnes's full-sized avatar
🎵
git push it, git push it real good

Eric Barnes ericlbarnes

🎵
git push it, git push it real good
View GitHub Profile
@ericlbarnes
ericlbarnes / Vagrantfile
Last active January 8, 2016 00:32
vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :forwarded_port, guest: 5432, host: 54320
# easy installation:
# brew install python
# sudo easy_install pip # PIP is recommended for installation
# sudo -s # Creates a new sudo shell
# export ARCHFLAGS="-arch i386 -arch x86_64" # Need to set some GCC flags
# exit
# sudo pip install fabric # Get the install on
# sudo pip install python-simple-hipchat
import os, getpass, random, hipchat
@ericlbarnes
ericlbarnes / helpers.php
Created September 4, 2013 13:04
Laravel hidden helpers
// DB Dumpers
DB::listen(function($sql)
{
var_dump($sql);
});
Event::listen('laravel.query', function($sql)
{
var_dump($sql);
@ericlbarnes
ericlbarnes / filters.php
Created July 16, 2013 17:30 — forked from anonymous/filters.php
Laravel CSRF Ajax
/**
* Filter to check for CSRF attacks from the ajax requests.
*/
Route::filter('csrf_header', function()
{
if (Session::token() != Request::header('x-csrf-token'))
{
throw new Illuminate\Session\TokenMismatchException;
}
});
this.selectize = this.$("#js-tags").selectize({
persist: true,
maxItems: null,
valueField: "tag",
labelField: "tag",
searchField: ["tag"],
options: tags.toJSON(), // Backbone collection
render: {
item: function(item) {
return "<div><i class='icon-tag'></i> " + item.tag + "</div>";
@ericlbarnes
ericlbarnes / foreach_limit.blade.php
Last active July 13, 2023 07:51
Limit a foreach with Laravel blade
@foreach (array_slice($posts->toArray(), 0, 5) as $post)
<h1>{{ $post['title'] }}</h1>
@endforeach
@ericlbarnes
ericlbarnes / gist:5423104
Last active December 16, 2015 10:49
Favorite Aspects of Laravel
I am curious on what is your favorite aspects to Laravel compared to other frameworks? If
you are trying to sell Laravel to another dev what would be your selling points?
@ericlbarnes
ericlbarnes / example.php
Created March 14, 2013 17:36
How I imagine composer.phar code.
echo "Loading composer repositories with package information";
echo "Updating dependencies";
sleep(9999999999);
.....
{{ email:form subject="Contact Form" to="[email protected]" required="name" }}
{{ if error}}
<h1>Error</h1>
<ul>
{{ errors }}
<li>{{error}}</li>
{{ /errors }}
</ul>
{{ endif }}
@ericlbarnes
ericlbarnes / Preferences.json
Created August 20, 2012 18:12
Sublime Text Preferences
{
"auto_complete_commit_on_tab": true,
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"fade_fold_buttons": false,
"font_face": "Panic Sans",
"font_size": 12.0,
"highlight_line": true,
"line_padding_bottom": 4,
"line_padding_top": 4,
"rulers":