Skip to content

Instantly share code, notes, and snippets.

Avatar
😃
fulfilled, like a resolved promise

Orlando Wenzinger Orlandster

😃
fulfilled, like a resolved promise
  • Zürich, Switzerland
View GitHub Profile
@delacruz-dev
delacruz-dev / reset.sh
Created Mar 9, 2017
Git Tip: Reset unstaged changes and files
View reset.sh
# Revert changes to modified files.
git reset --hard
# Remove all untracked files and directories. (`-f` is `force`, `-d` is `remove directories`)
git clean -fd
@umayr
umayr / recover-deleted-branch.sh
Created Apr 1, 2016
How to recover a deleted branch
View recover-deleted-branch.sh
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@thejmazz
thejmazz / .babelrc
Created Feb 16, 2016
async/await with webpack+babel
View .babelrc
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}
@Warry
Warry / Article.md
Created Dec 11, 2012
How to make faster scroll effects?
View Article.md

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

@CristinaSolana
CristinaSolana / gist:1885435
Created Feb 22, 2012
Keeping a fork up to date
View gist:1885435

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream