Skip to content

Instantly share code, notes, and snippets.

View ikhattab's full-sized avatar
🎮
.

Ihab Khattab ikhattab

🎮
.
View GitHub Profile
@ikhattab
ikhattab / gist:adea9ad49b20f9731cf2
Created December 10, 2015 07:10 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@ikhattab
ikhattab / autocomplete.json
Created October 5, 2015 12:27
Coffeescript autocomplete sublime text
"auto_complete_triggers": [
{
"characters": ".@",
"selector": "source.coffee, source.litcoffee, source.coffee.md"
}
]
@ikhattab
ikhattab / Delete all git branches which have been merged
Last active September 4, 2016 11:57
Delete all git branches which have been merged
git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d
@ikhattab
ikhattab / How to start as a Front-End Developer.md
Last active December 20, 2015 19:30
How to start as a Front-End Developer.md

##How to start as a Front-End Developer

I've been asked this question many times by friends/colleagues and never had the chance to answer it properly.

I believe it's not about how many things you need to know more than it's a process you should flow. also it's not all about learning you should practice skills you gained and sharpen them often.

So, I curated here what could work as a plan/resources for you to use:

HTML

It's about semantics here you should know how you can fully describe structure of data you are displaying and when to use different tags to describe what. This important for maintainability/performance of your code and also for search engine and screen readers.

git remote add upstream THE_SOURCE_REPO
git remote add YOUR_USER_NAME YOUR_FORK
git remote set-url origin THE_SOURCE_REPO
git remote set-url origin --push YOUR_FORK
git config --global push.default current
@ikhattab
ikhattab / 0_reuse_code.js
Created December 26, 2013 23:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ikhattab
ikhattab / Git Delete Last Commit.md
Last active December 31, 2015 06:09
Git Delete Last Commit

If you have committed junk but not pushed

git reset --soft HEAD~1

@ikhattab
ikhattab / npm ERR! Error: EMFILE, too many open files
Last active December 26, 2015 07:19
npm ERR! Error: EMFILE, too many open files
In terminal run
ulimit -n 8192
/**
* Assign a value to the delimited key in the given object. The inverse of `_.lookup`
*
* @example
*
* var myObj = {};
*
* _.assign(myObj, 'foo.bar', 'baz'); // myObj = { foo: { bar: 'baz' }}
*
* @param {Object} obj the object to assign to