A Pen by Muhammed Erdem on CodePen.
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft,elem.offsetTop,elem.offsetWidth,elem.offsetHeight,elem.offsetParent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| check process hhvm with pidfile /var/run/hhvm/pid | |
| group hhvm | |
| start program = "/usr/sbin/service hhvm start" with timeout 60 seconds | |
| stop program = "/usr/sbin/service hhvm stop" | |
| if failed unixsocket /var/run/hhvm/hhvm.sock then restart | |
| if mem > 400.0 MB for 1 cycles then restart | |
| if 5 restarts with 5 cycles then timeout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var request = require("request"), | |
| cheerio = require("cheerio"), | |
| url = "https://www.google.com/search?q=data+mining", | |
| corpus = {}, | |
| totalResults = 0, | |
| resultsDownloaded = 0; | |
| function callback () { | |
| resultsDownloaded++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * 1. create project at https://console.developers.google.com/project | |
| * 2. enable 'Analytics API' under 'APIs & auth' / APIs | |
| * 3. create 'NEW CLIENT ID' (OAuth client) under 'APIs & auth' / Credentials | |
| * i. select 'Service account' | |
| * ii. save generated key file to 'key.p12' | |
| * iii. remember CLIENT ID | |
| * 4. under GA account add 'Read & Analyze' access to newly generated email (access to GA Account not Property nor View) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Export WordPress post data to CSV | |
| * Based on <http://stackoverflow.com/a/3474698> and <http://ran.ge/2009/10/27/howto-create-stream-csv-php/> | |
| */ | |
| /** | |
| ********************************************************************* | |
| * Configuration | |
| ********************************************************************* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ['zip'=>'1000', 'name'=> 'Ljubljana'] | |
| ['zip'=>'1001', 'name'=> 'Ljubljana - P.P.'] | |
| ['zip'=>'1210', 'name'=> 'Ljubljana - Šentvid'] | |
| ['zip'=>'1211', 'name'=> 'Ljubljana - Šmartno'] | |
| ['zip'=>'1215', 'name'=> 'Medvode'] | |
| ['zip'=>'1216', 'name'=> 'Smlednik'] | |
| ['zip'=>'1217', 'name'=> 'Vodice'] | |
| ['zip'=>'1218', 'name'=> 'Komenda'] | |
| ['zip'=>'1219', 'name'=> 'Laze v Tuhinju'] | |
| ['zip'=>'1221', 'name'=> 'Motnik'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Excel 2003 XML-Parser | |
| * | |
| * PHP library for parsing Microsoft Excel 2003 XML Spreadsheet | |
| * http://gist.github.com/862741 | |
| * | |
| * Copyright (c) 2011 Faisalman <movedpixel@gmail.com> | |
| * |
NewerOlder