Skip to content

Instantly share code, notes, and snippets.

@Warry
Warry / Article.md
Created December 11, 2012 00:11
How to make faster scroll effects?

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:

@oodavid
oodavid / README.md
Last active March 11, 2025 21:41 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@jeremyhaile
jeremyhaile / Android Haml
Created April 7, 2011 15:08
Example of an android XML file in HAML
!!! XML
- xmlns = {"xmlns:android" => "http://schemas.android.com/apk/res/android"}
- id = "android:id"; width = "android:layout_width"; height = "android_layout_height"; text = "android:text"; orientation = "android:orientation"
%LinearLayout{ xmlns, width => "fill_parent", height => "fill_parent", orientation => "vertical" }
%TextView{ id => "@+id/text", width => "wrap_content", height => "wrap_content", text => "Hello, I am a TextView" }
%Button{ id => "@+id/button", width => "wrap_content", height => "wrap_content", text => "Hello, I am a Button" }