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

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.

<?php
/**
* PHP versions 5
*
* @copyright 2011 k-holy <k.holy74@gmail.com>
* @author k.holy74@gmail.com
* @license http://www.opensource.org/licenses/mit-license.php The MIT License (MIT)
*/
namespace Holy\Silex\Provider;
/* ===== Primary Styles =====================================================
Author: Fruitcake Studio (Barry vd. Heuvel)
========================================================================== */
//Generate a custom (semantic) grid
.customGrid(@gridColumnWidth, @gridGutterWidth){
#header, #main {
.row();
}
.block {
@import "bootstrap/responsive.less"; //Disable importing variables and mixins, causes to break..
// LANDSCAPE PHONE TO SMALL DESKTOP & PORTRAIT TABLET
// --------------------------------------------------
@media (max-width: 767px) {
.customGrid(auto, 0);
}
// PORTRAIT TABLET TO DEFAULT DESKTOP
// ----------------------------------
Handlebars.registerHelper('pagination', function(currentPage, totalPage, size, options) {
var startPage, endPage, context;
if (arguments.length === 3) {
options = size;
size = 5;
}
startPage = currentPage - Math.floor(size / 2);
endPage = currentPage + Math.floor(size / 2);