Skip to content

Instantly share code, notes, and snippets.

View dyaa's full-sized avatar

Dyaa dyaa

View GitHub Profile

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);
<?php
class Users_Controller extends Base_Controller {
public function action_index() {
$id = Input::get('id');
if ($id) {
$user = DB::table('users')->where('id', $id)->first();
@turquoise: #95A5A6;
@emerald: #2ECC71;
@peter-river: #3498DB;
@amethyst: #9B59B6;
@wet-asphalt: #34495E;
@green-sea: #16A085;
@nephritis: #27AE60;
@belize-hole: #2980B9;
@wisteria: #8E44AD;
@midnight-blue: #2C3E50;

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@dyaa
dyaa / css_resources.md
Created March 19, 2014 22:37 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' );
}
?>hi
@dyaa
dyaa / directive
Last active August 29, 2015 14:16 — forked from SelrahcD/gist:7042692
Using PrismJs with AngularJs
angular.module('Prism', []).
directive('prism', [function() {
return {
restrict: 'A',
link: function ($scope, element, attrs) {
element.ready(function() {
Prism.highlightElement(element[0]);
});
}
}
@dyaa
dyaa / addroute
Created September 22, 2015 15:18 — forked from kunal732/addroute
Adding Route to Meteor
Meteor.Router.add({
'/inbound': function() {
post = this.request.body;
color = post.subject;
Colors.update({pos: 1},{ $set: { "name": color } } );
return [200, "Success"]
}
});
Tags: Sublime Text 2 License Key, Sublime Text 3 License Key, Sublime Text Full Version, Sublime Text 3 version 3103.
Go to menu Help > Enter License.
—– BEGIN LICENSE —–
Michael Barnes
Single User License

URLs into Indexed DB, via Service Workers

Let's say you're using Indexed DB for the offline data store for a catalog. One of the object stores contains product images. Wouldn't it be great if you could just have something like this in your catalog page?

<img src="indexeddb/database/store/id">