Skip to content

Instantly share code, notes, and snippets.

View mshamma's full-sized avatar

Mohammed Shamma mshamma

View GitHub Profile
import Ember from 'ember';
export default Ember.Component.extend({
tagName: "section",
page: 1,
paginateBy: 10,
paginatedItems: Ember.computed('amenities', 'page', function(){
var i = (parseInt(this.get('page')) - 1) * parseInt(this.get('paginateBy'));
var j = i + parseInt(this.get('paginateBy'));
return this.get('items').slice(i, j);
@mshamma
mshamma / django_jwt_cookie.py
Created March 21, 2017 21:12 — forked from elnygren/django_jwt_cookie.py
Teach Django to use JWT tokens inside the session cookie - plays well with django-rest-framework-jwt.
@mshamma
mshamma / main.go
Created August 28, 2016 22:26 — forked from phalt/main.go
Simple HTTP API in Go
package main
import (
"github.com/gin-gonic/gin"
"database/sql"
"github.com/coopernurse/gorp"
_ "github.com/mattn/go-sqlite3"
"log"
"time"
"strconv"
@mshamma
mshamma / introrx.md
Created November 20, 2015 21:16 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing