Skip to content

Instantly share code, notes, and snippets.

seifsallam / 0_reuse_code.js
Created Jun 3, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View sendAction as a promise.js
// A PromiseAction is an action set on the controller,
// but not in the actions hash, which allows it to be
// passed in directly to the component. The component
// just sees it as a function that it can call that
// returns a promise. This is nice for when the component
// needs to emit some action that can fail; if it fails
// it can clean up after itself.
// Example:
// export default Controller.extend({
* Authentication Initializer
Authorizer = Ember.SimpleAuth.Authorizers.Base.extend(
authorize: (jqXHR, requestOptions) ->
unless Ember.isEmpty @get('session.auth_token')
jqXHR.setRequestHeader 'x-authentication-token', @get('session.auth_token')
seifsallam /
Created Oct 8, 2013
LoadMoreMixin for EmberJS
# Loadmore Mixin
# It works with limit/skip & max_id
# SETUP: To Use it add this mixin to both View & Controller
# It binds the view to scroll, and if user scrolled to the
# bottom it sends modelName to controller.
seifsallam /
Last active Dec 21, 2015
This the bash_profile for my local development settings. ( Command + Name ) or ( Command + Project initials ) or ( Command Initials ) Hope this helps, if you have more tips, I'd love to hear them.
# Color Terminal
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# Local Settings
alias ebash='vim ~/.bash_profile' # Edit bash
alias sbash='source ~/.bash_profile' # Source Bash
alias evars='vim ~/.rbenv/vars' # Edit rbenv Variables
alias pvars='rbenv vars' # Print rbenv Variables
seifsallam /
Last active Dec 21, 2015
ember notes to remember


Router > Controller > View > Template

URL based navigation. Main pages of the application


Controller > View > Template

Small elements that you need to insert into Template, but doesn't have any relation to the outlet. Like new post, modal views, ...etc.


View > Template

seifsallam / Development
Last active Dec 20, 2015
Rails, mongodb, redis OSX setup
View Development


  • Install Homebrew ruby -e "$(curl -fsSL"
  • Install imageMagik brew install imagemagick

Setup Ruby

  • brew update
  • brew install rbenv
  • brew install ruby-build. Replace ruby-build with any ruby version you want
  • Install rbenv-vars
  • Install rbenv-rehash
seifsallam / .bashrc
Last active Dec 19, 2015 — forked from joequery/gist:1607063
Enable disable a Nginx configuration from `/sites-available`
View .bashrc
## NGINX helpers
# Kill and restart nginx
function restart_nginx(){
pids=$(pidof nginx)
if [[ -n $pids ]];
sudo kill -9 $pids
seifsallam / RESTAdapter.js
Last active Aug 15, 2016
Ember RESTAdapter configuration for sending HTTP header and CrossDomain Access
View RESTAdapter.js
// store.js
App.Adapter = DS.RESTAdapter.reopen({
bulkCommit: false,
url: 'http://localhost:5000',
namespace: 'api',
corsWithCredentials: true,
headers: {
'Accept': 'application/vnd.vendor+json;version=1',
'Content-type': 'application/json',
seifsallam / Deploying Ember on
Last active Dec 18, 2015
Deploying ember on heroku using yeoman
View Deploying Ember on

Deploying Ember on Heroku using Yeoman

  1. I'm going to assume here that you have an ember application ready that you want to deploy.
  2. Install Generator Heroku using the steps there, and don't forget to add the block of code to your gruntfile.js. You should find the copy tag already there, just append to it
  3. The run grunt build command to generate the /dist folder. That will complie everything and generate your web-app
  4. If you want you can test it using grunt server:dist
  5. Now go to /dist folder
  6. Create a heroku app heroku create
  7. Commit everything in the dist folder (Don't go up to your root direcotry, you want to commit update to heroku) I used github to add local repo and manage everything from there.