Skip to content

Instantly share code, notes, and snippets.

View msalahz's full-sized avatar
🎯
Focusing

Mohammed Zaghloul msalahz

🎯
Focusing
View GitHub Profile
@msalahz
msalahz / extended-ember-validations-controller.js
Last active August 29, 2015 14:15
Extended Ember Validations Controller Mixin extend original ember validations component controller mixin with IsValid & IsInvalid properties for each validated property and model validation errors array.
// This mixin extend original ember validations component controller mixin with
// IsValid & IsInvalid properties for each validated property and model validation errors array
// Module import for Ember
import Ember from 'ember';
// Module import for Ember-Validations component
import EmberValidations from 'ember-validations';
// Module export for extended ember validations controller mixin definition
export default Ember.Mixin.create(EmberValidations.Mixin,{
init() {
// this call is necessary to execute parent activate hook if existed and avoid overriding it
@msalahz
msalahz / Brocfile.js
Last active August 29, 2015 14:16 — forked from lukes/Brocfile.js
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp({
// Custom settings for broccoli-assets-rev
// See http://www.ember-cli.com/#asset-compilation
fingerprint: {
enabled: true
}
});
@msalahz
msalahz / Update Ember-Cli project to use last ember beta version and HTMLBars and remove ember-data.md
Last active August 29, 2015 14:16
Update Ember-Cli project to use last ember beta version and HTMLBars and remove ember-data

Clean

bower uninstall --save handlebars # remove handlebars bower package

bower uninstall --save ember # remove emebr bower package

bower uninstall --save ember-data # remove ember-data bower package

npm rm --save-dev ember-data # remove ember-data npm package

@msalahz
msalahz / Ember-Cli common addons install commands.md
Last active August 29, 2015 14:16
Ember-Cli common dependencies

##Uninstall

npm uninstall --save-dev ember-breadcrumbs

npm uninstall --save-dev ember-cli-uploader

npm uninstall --save-dev ember-cli-simple-auth

npm uninstall --save-dev ember-cli-simple-auth-cookie-store

###Setup

npm uninstall -g ember-cli -- Remove old global ember-cli

npm cache clean -- Clear NPM cache

bower cache clean -- Clear Bower cache

npm install -g ember-cli@0.2.0-beta.1 -- Install new global ember-cli

@msalahz
msalahz / Convert Ember resorce or route from normal Ember-Cli file structure to pods style.md
Last active August 29, 2015 14:18
Convert Ember resorce/route from normal Ember-Cli file structure to pods style

#Convert Ember resorce/route from normal Ember-Cli file structure to pods style

###Convert Ember resorce from normal Ember-Cli file structure to pods style

ember g resource dashboard

cp app/controllers/dashboard.js app/pods/dashboard/controller.js

cp app/routes/dashboard.js app/pods/dashboard/route.js

//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@msalahz
msalahz / ember-video-uploader-component.js
Created April 29, 2015 15:32
Ember Video Uploader Component
import Ember from 'ember';
import EmberUploader from 'ember-uploader';
export default EmberUploader.FileField.extend({
// restrict video upload only
accept: "video/*",
// video property default value
videoFile: null,
// videoUrl property default value
videoUrl: null,
@msalahz
msalahz / fix-PyCharm-java-error-on-ubuntu.md
Last active September 23, 2016 08:24
Fix PyCharm java error on Ubuntu

add this line /usr/lib/jvm/java-8-openjdk-amd64 to $HOME/.PyCharm2016.2/config/pycharm.jdk file

and this line export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 to /etc/profile.d/oraclejdk.sh file

Use source to load the variables, by running this command: source /etc/profile.d/oraclejdk.sh

Then check the variable, by running this command: echo $JAVA_HOME

@msalahz
msalahz / fix-inotify-watches-limit-error.md
Last active September 17, 2016 13:52
Fix Inotify Watches Limit error

Inotify Watches Limit

Unfortunately, the default limit of watch handles may not be enough for reasonably sized projects, and reaching the limit will force IntelliJ platform to fall back to recursive scans of directory trees.

To prevent this situation it is recommended to increase the watches limit (to, say, 512K):

  • Add the following line to either /etc/sysctl.conf file or a new *.conf file (e.g. idea.conf) under /etc/sysctl.d/ directory:

fs.inotify.max_user_watches = 524288