Skip to content

Instantly share code, notes, and snippets.

View cherifGsoul's full-sized avatar
🎯
Focusing

Cherif Bouchelaghem cherifGsoul

🎯
Focusing
View GitHub Profile
<?php
/**
* CKEditorHelper
* - Allow you to easily add CKEditor textareas to your application
*
*/
class CkeditorHelper extends AppHelper {
/**
* Helpers
@cherifGsoul
cherifGsoul / dabblet.css
Created December 17, 2011 09:54
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
@cherifGsoul
cherifGsoul / RestController.php
Last active November 1, 2018 13:54
Yii simple rest controller exemple
<?php
/**
* Controller is the customized base controller class.
* All controller classes for this application should extend from this base class.
*/
class RestController extends CController
{
/**
* @var string the default layout for the controller view. Defaults to '//layouts/column1',
* meaning using a single column layout. See 'protected/views/layouts/column1.php'.

Purpose

Client-side models are becoming more common. Most work with JSON-REST interfaces by default. However, there is no standards around manipulating the set of data returned by a rest service. This attempts to come to some standard.

Goal

  • Make it easy to understand and have close parallels with common SQL paradigms and relational algebra.
  • Make work with standard server-side Query string libraries.

Existing Problems

CanJS Notification System

This widget creates a growl-like notification on a website using CanJS framework.

JavaScript

steal('can/construct',
	  'can/construct/super',
	  'can/construct/proxy',

'can/control',

@import "colors";
@import "buttons.scss";
@import "compass/css3";
@mixin tabs {
float: left;
width: 100%;
background: transparent;
margin: 0!important;
height: 43px;

Susy Tutorial

For this tutorial I'm assuming you are already comfortable with CSS, Sass (I'll use the SCSS syntax) and Compass. Please get set up with each one of those before attempting to use Susy. Sass and Compass both have their own setup instructions and tutorials that you can use.

There is also reference documentation in the works.

What Susy Does

CSS Systems

Backbone helps you structure your application. This is great, but it doesn't solve the whole problem. CanJS helps you structure your application and lets you actually focus on the part that matters, which is your data.

CanJS essentially gives you all the simplicity of Backbone (model and control layer and no weird asynchronous event loop like Ember and Angular), along with more advanced features that make writing apps much faster and the code more maintainable.

Backbone is popular because its very simple and easy to understand. They are aiming for that level JUST above basic jQuery development, people who just learned jQuery and are looking for a way to organize their code a bit more. It provides this. So does CanJS. But for large complex applications, Backbone lacks a lot of the things we need to make a great app.

Live Binding

Backbone has no concept of binding data object and their changes to your templates.

@cherifGsoul
cherifGsoul / Post.php
Last active December 20, 2015 09:29
Yii PHP framework Component
<?php
/**
*
*/
class Post extends CComponent
{
private $id;
private $title;
private $content;
private $categorie;
@cherifGsoul
cherifGsoul / Post.php
Created July 29, 2013 21:07
Simple php classe
<?php
/**
*
*/
class Post
{
private $id;
private $title;
private $content;
private $categorie;