Skip to content

Instantly share code, notes, and snippets.

@seifsallam
seifsallam / RESTAdapter.js
Last active August 15, 2016 19:37
Ember RESTAdapter configuration for sending HTTP header and CrossDomain Access
// 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
seifsallam / load_more_mixin.coffee
Created October 8, 2013 07:32
LoadMoreMixin for EmberJS
###*
#
# Loadmore Mixin
# It works with limit/skip & max_id
#
# SETUP: To Use it add this mixin to both View & Controller
#
# HOW IT WORKS:
# It binds the view to scroll, and if user scrolled to the
# bottom it sends modelName to controller.
@seifsallam
seifsallam / bash_profile.sh
Last active December 21, 2015 07:29
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
seifsallam / ember_notes.md
Last active December 21, 2015 06:59
ember notes to remember

Outlet:

Router > Controller > View > Template

URL based navigation. Main pages of the application

Render:

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.

Component:

View > Template

@seifsallam
seifsallam / Development Setup.md
Last active December 20, 2015 08:49
Rails, mongodb, redis OSX setup

Global

  • Install Homebrew ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
  • 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
seifsallam / .bashrc
Last active December 19, 2015 10:29 — forked from joequery/gist:1607063
Enable disable a Nginx configuration from `/sites-available`
##
## NGINX helpers
##
# Kill and restart nginx
function restart_nginx(){
pids=$(pidof nginx)
if [[ -n $pids ]];
then
sudo kill -9 $pids
@seifsallam
seifsallam / Deploying Ember on heroku.md
Last active December 18, 2015 14:48
Deploying ember on heroku using yeoman

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.
@seifsallam
seifsallam / Moving from ember-rails to Yeoman.md
Last active December 18, 2015 14:39
If you were using ember-rails and want to move it out to its own app. Here are the steps using Yeoman

Using Yo Ember instead of Ember-Rails

First Generate Ember application using Yo Ember generator

  1. Install yeoman npm install -g yo grunt-cli bower
  2. Install ember-generator npm install -g generator-ember
  3. Create your project mkdir webapp && cd webapp
  4. Generate ember template yo ember
  5. Run itgrunt server
@seifsallam
seifsallam / Default (OSX).sublime-keymap.json
Last active December 18, 2015 12:49
SublimeText 2 Configuration
[
{
"keys": ["ctrl+shift+t"],
"command": "delete_trailing_spaces"
},
{
"keys": ["ctrl+shift+d"],
"command": "toggle_trailing_spaces"
},
{
@seifsallam
seifsallam / asknative gems.md
Last active December 18, 2015 12:39
Gems used for asknative's Ruby on Rails API

Gemfile

  • Mongoid for mongodb communication
  • Devise for authentication and oAuth
  • Active Model Serializer for JSON formatting. Alot cleaner and faster than hash views solutions like RABL
  • Api versions for versioning API
  • Sidekiq for background jobs. Awesome dashboard and alot easier (with less bugs) than resque
  • HTTParty for sending push notifications to pushbots
  • SendGrid for sending emails
  • LetterOpener for viewing emails in the browser (Development)
  • Roadie for compiling css to be inline for emails