Skip to content

Instantly share code, notes, and snippets.

View skippednote's full-sized avatar

Bassam Ismail skippednote

View GitHub Profile
p,
header,
blockquote,
footer {
margin: 0;
}
@skippednote
skippednote / BEM-inuit.css.md
Created October 21, 2012 18:12 — forked from csswizardry/BEM-inuit.css.md
Thoughts on BEM for inuit.css

Bringing BEM to inuit.css

BEM is a methodology for naming and classifying CSS selectors in a way to make them a lot more strict, transparent and informative.

The naming convention follows this pattern:

.block{}
.block__element{}
.block--modifier{}

So I installed MongoDB using brew without any issue. However when I run mongo I get this error

MongoDB shell version: 2.2.3
connecting to: test
Thu Feb 14 18:20:49 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed

Starters guide to MongoDB

Installing MongoDB

I'll be covering how to install Mongo on Unix and Linux platform only. I don't want to bother myself with the hassles of installing Mongo on Windows OS, it's just too much work.

Presuming that you have Ruby installed, run this command in the terminal

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Once Installed, open two terminal windows and run mongod in the first window and mongo in the second window after that. mongod will start the server and start listening for the connection on port 27017. With mongo we start the interactive JavaScript shell interface to MongoDB and run all the commands from there.

COMMUNITY HANDBOOK

Why?

Community plays an essential role in a developers life and so does a developer. As developers there will be scenarios where we need to connect with peers, people in communities (online and offline) and sometimes strangers over the interweb. There will be several reasons why you will have to take time from your work and get out there and communicate with people. You might be facing a problem and searching for a solution or you are just a kind soul who wants to help others. Maybe you want to share your product or research with the community.

Joining

Front-end Guideline

A guideline to maintain consistency when writing code - HTML, CSS and JavaScript.

HTML

Doctype

To make the page render as intended and support all the latest HTML5 features make sure to add the doctype on top of the page.

	<!DOCTYPE html>

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

MNN Mobile

Case Study

Objective

With such a high traffic and increasing number of visitors from mobile devices it was obvious to serve the users better by providing a mobile site. Users could already access the mobile site on m.mnn.com however the site only had the fraction of the content being displayed on the full blown site.

Challenge

Provide the a better user experience on mobile phones while managing behemoth of a content.

@skippednote
skippednote / app.js
Created August 18, 2013 11:36
Ajax request to sub-reddit
$.ajax({
url: 'http://www.reddit.com/r/aww/.json?jsonp',
dataType: 'jsonp',
success: function( resp ) { resp.data.children.forEach(function(entry, i){
var pic = "<img src="+ entry.data.url+">";
console.log(i);
$("#target").append("<li>" + pic + "</li>");
i++;
});

Creating RESTFul APIs using Express.js and Node.js

When building web app using client-side JavaScript frameworks like Backbone, Ember, Knockout, etc, Node.js comes up as a strong contender for the backend. Though we can use almost anything varying from Ruby on Rails to dot Net, Node.js provides some amazing features (Asynchronous!) which make it hard to ignore. Although Node.js is meant for very low level tasks and can be used to build things like Chat servers, Ad servers, and File Transfer app, there are several frameworks that are built on top of Node.js which we can use to create a REST API or even full-fledged web applications.

We will use Express.js, a web application framework that uses Connect middleware to create a REST API which we will be able to serve to our client side frameworks. Express.js, apart from the Connect's mid