How to set up a Headless Selenium Testing environment for CentOS 6.3.
Follow these steps to set up a CentOS 6.3 host to run headless Selenium tests with Firefox.
| // Check for browser support of event handling capability | |
| if (window.addEventListener) | |
| window.addEventListener("load", downloadJSAtOnload, false); | |
| else if (window.attachEvent) | |
| window.attachEvent("onload", downloadJSAtOnload); | |
| else window.onload = downloadJSAtOnload; |
| #!/bin/bash | |
| SSH_USER="user@sftp.domain.com" # your sftp credentials | |
| SSH_KEY="~/.ssh/id_rsa" # your ssh private key | |
| DOCUMENT_ROOT="/www/vhosts/mywebsite.com/htdocs" # directory on the remote server | |
| LOCAL_DIR="~/mywebsite.com/public" # directory on your local machine | |
| REMOTE_DIR="_remote_dir" # temporary mount point | |
| mkdir -p $REMOTE_DIR | |
| sshfs $SSH_USER:$DOCUMENT_ROOT $REMOTE_DIR -o workaround=rename -o defer_permissions -o IdentityFile=$SSH_KEY |
| //To fetch a branch, you simply need to: | |
| git fetch origin | |
| //This will fetch all of the remote branches for you. With the remote branches | |
| //in hand, you now need to check out the branch you are interested in, giving | |
| //you a local working copy: | |
| git checkout -b test origin/test |
| # USEFUL PLESK COMMANDS | |
| # restart plesk | |
| /etc/init.d/psa restart | |
| # reload plesk configs (useful for vhost.conf) | |
| /usr/local/psa/admin/sbin/websrvmng -a -v | |
| # restart qmail | |
| service qmail restart |
| <?php | |
| // Disable update notification for individual plugins | |
| function filter_plugin_updates( $value ) { | |
| unset( $value->response['block-spam-by-math-reloaded/block-spam-by-math-reloaded.php'] ); | |
| return $value; | |
| } | |
| add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' ); | |
| ?> |
| function basename( path ) | |
| { | |
| return path.replace( /\\/g, '/' ).replace( /.*\//, '' ); | |
| } | |
| function dirname( path ) | |
| { | |
| return path.replace( /\\/g, '/' ).replace( /\/[^\/]*$/, '' ); | |
| } | |
| console.log( dirname( '/srv/www/dev/umid/admin/cfg.admin.php' ) ); |
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: svnserve | |
| # Required-Start: $network $local_fs $remote_fs | |
| # Required-Stop: $network $local_fs $remote_fs | |
| # Should-Start: $all | |
| # Should-Stop: $all | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 |
| (function() { | |
| var CSSCriticalPath = function(w, d, opts) { | |
| var opt = opts || {}; | |
| var css = {}; | |
| var pushCSS = function(r) { | |
| if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
| var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
| for(var i = 0; i < styles.length; i++) { | |
| if(!!styles[i] === false) continue; | |
| var pair = styles[i].split(": "); |
These examples show you how to do responsive video both HTML 5 based and embedded video from YouTube (can work with video embedded from other sites). All of the HTML and CSS on this page is based on the good work done by Thierry Koblentz and Chris Coyier. See the HTML for links to their work.
A Pen by chris0stein on CodePen.