Skip to content

Instantly share code, notes, and snippets.

View rtablada's full-sized avatar

Ryan Tablada rtablada

View GitHub Profile
@rtablada
rtablada / application.js
Created August 27, 2015 14:58
This is an adapter for firebase to allow you to store extra user information
import Ember from 'ember';
import ToriiFirebaseAdapter from 'emberfire/torii-adapters/firebase';
export default ToriiFirebaseAdapter.extend({
firebase: Ember.inject.service(),
open(authentication) {
return new Ember.RSVP.Promise((resolve, reject) => {
this.store.find('user', {uid: authentication.uid}).then((users) => {
if (users.get('length')) {
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@rtablada
rtablada / nginx.sh
Created January 30, 2014 04:54
A provisioning script for setting up nginx for an existing Laravel project with Vapobrash
#!/usr/bin/env bash
echo ">>> Updating Nginx"
# Chech that Nginx is installed
nginx -v > /dev/null 2>&1
NGINX_IS_INSTALLED=$?
if [ $NGINX_IS_INSTALLED -eq 0 ]; then
# Change default vhost created
@rtablada
rtablada / gist:8899537
Created February 9, 2014 14:05
Ideas for Laravel Packages

NoSQL history/analytics event recorder (pgsql json driver)

Allows you to record and query event data stored in NoSQL for analytics. Written originally with a PGSQL driver but extensible for use with Mongo, Couch, etc.

JSON based Cron Job Lister

Allows you to create a JSON file of artisan, bash, or cron tasks to add to the crontab Tracks and modifies crontab to add cronjobs.

@rtablada
rtablada / gist:8941013
Created February 11, 2014 18:30
Sublime 2 Plugins For My Day To Day Workflow

Color

  • Dayle Rees Colour Schemes (Riding the development repo) - Keen

Must Haves

  • Advanced New File
  • Alignment
  • ChangeQuotes
  • ColorPick - MacOSX color picker
  • DashDoc - Checks the API in Dash for OSX
  • DocBlokr
@rtablada
rtablada / gist:9043781
Created February 17, 2014 02:40
Do you test all the child classes of an abstract class?

So if I have a parent abstract class that is fully implemented except for the defining property number:

abstract class DividesByFive
{
	protected $number;

	public function getResult()
	{
 return $this->number / 5;
@rtablada
rtablada / routes.php
Last active August 29, 2015 13:56
Thoughts on literate Laravel Routes
<?php
// Images
Route::get('images', ['uses' => 'Images@index', 'as' => 'images.index']);
Route::get('images/new', ['uses' => 'Images@create', 'as' => 'images.create']);
Route::post('images', ['uses' => 'Images@store', 'as' => 'images.store']);
@rtablada
rtablada / at.sh
Created February 27, 2014 14:33
Use atom from the command line
ln -s /Applications/Atom.app/Contents/Resources/app/atom.sh ~/bin/atom
@rtablada
rtablada / gist:9589842
Created March 16, 2014 21:00
Modification of @fideloper's Validator to allow Model based validations
<?php namespace Initr\Services;
use Illuminate\Validation\Factory as LaravelValidator;
abstract class Validator
{
protected $validator;
protected $data = array();
<?php
// The controller knows too much
Queue::push('Listeners\\UserCreator', [$data])->then(['ConfirmationEmailSender', 'AdminNewUserAlerter', 'MonthlySignupCountUpdater', 'UserTrialActivator']);
// Instead the createUser task should know what to call or better yet, call an event on the event stack before deleting the job
Queue::push('Listeners\\UserCreator', [$attributes]);
class UserCreator {
public function fire($job, $data) {