Add ipv6 entries in /etc/hosts for MAMP hosts, avoid slow dns resolution.
It must be executed after each MAMP restart.
See http://stackoverflow.com/questions/6841421/mac-osx-lion-dns-lookup-order
| <?php | |
| list($usec, $sec) = explode(' ', microtime()); | |
| $timer = (float)$usec + (float)$sec; | |
| // | |
| // YOUR CODE HERE | |
| // | |
| list($usec, $sec) = explode(' ', microtime()); |
| $path = '/usr/share/php'; | |
| include_once $path . '/xhprof_lib/utils/xhprof_lib.php'; | |
| include_once $path . '/xhprof_lib/utils/xhprof_runs.php'; | |
| xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); | |
| // YOUR CODE HERE | |
| $namespace = 'app_namespace'; | |
| $xhprof_data = xhprof_disable(); |
Add ipv6 entries in /etc/hosts for MAMP hosts, avoid slow dns resolution.
It must be executed after each MAMP restart.
See http://stackoverflow.com/questions/6841421/mac-osx-lion-dns-lookup-order
| for i in /var/www/*; do | |
| if [ -d "$i/dev/www/sites/default" ]; then | |
| alias `basename $i`="cd $i/dev/www/sites/default" | |
| fi | |
| done |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>DC Austin Videos</title> | |
| <script src="//underscorejs.org/underscore-min.js"></script> | |
| <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> | |
| </head> | |
| <body> | |
| <script id="tmpl-videos" type="text/template"> |
This should be placed in /etc/apache2/conf.d and will provide global robot exclusion for all sites in the server.
The /var/www/robots.txt content is provided.
| <!doctype><html><head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <title>Odyssey.js Slides</title> | |
| <meta name="description" content=""> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <link rel="icon" type="image/x-icon" href="http://cartodb.github.io/odyssey.js/editor/favicon.png"> | |
| <link rel="icon" type="image/png" href="http://cartodb.github.io/odyssey.js/editor/favicon.png"> |
| <?php | |
| $from_value = '2011-10-04 00:00:00'; | |
| // Create a date using the original timezone. | |
| $from_timezone = 'America/New_York'; | |
| $date = new DateTime($from_value, new DateTimeZone($from_timezone)); | |
| // Move the date to another timezone. | |
| $to_timezone = 'UTC'; |
Recently an optical illusion video became popular and I've tried to implement the same animation using d3.js.
Basically it seems that the circles are moving in a circle but they are all moving in straight lines.
I'm starting to learn d3.js to I'm open to any comments about how to improve the implementation.