Skip to content

Instantly share code, notes, and snippets.

<?php
class ApiController extends Controller
{
public function missingAction($actionID)
{
$request_type = $_SERVER['REQUEST_METHOD'];
/*------

Mock-Fake

Purpose

Add new command to ember-cli to speed up prototyping out a new idea like this:

ember generate mock-fake post --fields="title:string, body:string, comment:hasMany, author:belongsTo" 

With that one command you will have everything you need to fake a backend for your ember app.

# Created by http://www.gitignore.io
### Laravel4 ###
/bootstrap/compiled.php
.env.*.php
.env.php
### Composer ###
composer.phar
<?php
// Adding this to your app/artisan.php file will
// do a quick confirmation that you really do want
// to run this command when in production environment
if (App::environment() === 'production') {
echo "\033[0;33m======== WARNING ========\n";
echo "===== IN PRODUCTION =====\n";
echo "=========================\n";
@cullymason
cullymason / bootstrapIcon.js
Created October 7, 2013 18:14
A simple Handlebars helper for using bootstrap icons icons. Simple but useful.
Ember.Handlebars.registerBoundHelper('icon', function(iconName) {
iconName = iconName.toString();
return new Handlebars.SafeString("<span class='glyphicon glyphicon-"+iconName+"'></span>");
});
@cullymason
cullymason / explaination.md
Last active December 22, 2015 16:09
Ember Restful Ember-Data adapter

A Brief Explaination

I wish there were an ember-data adapter that would use the url instead of using query strings for looking up related models

For example pull from url/model/model_id/releatedModel/ instead of pulling from url/relatedModel?ids="3,4,5"

An example

You have a company with different departments filled with employees serving different roles in the company. So you would have models like this in Ember:

@cullymason
cullymason / Functions.sh
Created August 14, 2013 00:27
A little script to automate the deployment code from a cvs
#!/bin/bash
FUNCTIONS_IMPORTED="CHECK!"
function deploy() {
echo -e " ${bold}deploying...${normal}"
(cd $deploy_menu; cvs checkout $MODULE;)
}
function check_module() {
@cullymason
cullymason / Laravel_Ember.md
Last active December 20, 2015 21:38
It would be nice if we had a plugin that allows Laravel to play nice with Ember. Put simply I would like to create an easy way for Laravel to output JSON strings in a way that Ember likes.

Basic Explaination

It would be nice if we had a plugin that allows Laravel to play nice with Ember. Put simply I would like to create an easy way for Laravel to output JSON strings in a way that Ember likes.

What Laravel Does

return Model::find($id);
@cullymason
cullymason / Index.html
Created May 30, 2013 22:21
Here is the basic problem I am having: If I visit the site from say "http://localhost/#/categories" and then click on a category it does not display the badges for that category. However if I go to the category directly, "http://localhost/#/categories/2/", then it loads all of the badges just fine. I know that this would be easier in a jsbin bu…
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="<?php echo Request::root() ?>css/normalize.css">
<link rel="stylesheet" href="<?php echo Request::root() ?>css/style.css">
<link rel="stylesheet" href="<?php echo Request::root() ?>/css/bootstrap.css" type="text/css">
<link rel="stylesheet" href="<?php echo Request::root() ?>/css/style.css" type="text/css">
<style type="text/css">