Skip to content

Instantly share code, notes, and snippets.

@Bodom78
Bodom78 / whm-change-document-root.md
Last active November 24, 2024 10:19
WHM/cPanel - Changing an accounts document root

To properly edit an accounts DocumentRoot go to /var/cpanel/userdata/username/ (replace username with the actual cPanel username for the account), then edit the file domain.com (where domain.com is your primary domain name).

You will see something like this in that file:

documentroot: /home/username/public_html

You will also see the cgi-bin area in this section:

scriptalias:
@DinisCruz
DinisCruz / 87-prettify-url-on-pop-under-window.js
Last active May 6, 2023 00:09
Misc Chrome extensions code snippets (to add to helper doc)
url = 'http://127.0.0.1:4444/wd/hub/sessions'
options = { active:true, windowType:"normal", currentWindow: true }
chrome.tabs.query(options,function(tabs)
{
tabId = tabs[0].id
console.log(tabId)
chrome.tabs.update(tabId, {url: url})
chrome.tabs.executeScript(tabId, {file:'bower_components/jquery/dist/jquery.min.js'}, function()
@miguelmota
miguelmota / default
Last active January 21, 2025 09:11
Nginx + Node.js server configuration. Blog post: http://www.miguelmota.com/blog/nodejs-and-ngnix-on-ubuntu/
# The upstream module is the link between Node.js and Nginx.
# Upstream is used for proxying requests to other servers.
# All requests for / get distributed between any of the servers listed.
upstream helloworld {
# Set up multiple Node.js webservers for load balancing.
# max_fails refers to number of failed attempts
# before server is considered inactive.
# weight priorities traffic to server. Ex. weight=2 will recieve
# twice as much traffic as server with weight=1
server <your server ip>:3000 max_fails=0 fail_timeout=10s weight=1;
@addyosmani
addyosmani / headless.md
Last active May 17, 2024 03:38
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@jaydson
jaydson / gist:1780598
Created February 9, 2012 15:11
How to detect a click event on a cross domain iframe
var myConfObj = {
iframeMouseOver : false
}
window.addEventListener('blur',function(){
if(myConfObj.iframeMouseOver){
console.log('Wow! Iframe Click!');
}
});
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){
@mohamedmansour
mohamedmansour / click.js
Created July 16, 2011 01:09
Simulate a click in JavaScript for Google+ Share
function simulateClick(element) {
var clickEvent = document.createEvent("MouseEvents")
clickEvent.initEvent("mousedown", true, true)
element.dispatchEvent(clickEvent);
clickEvent = document.createEvent("MouseEvents")
clickEvent.initEvent("click", true, true)
element.dispatchEvent(clickEvent);
clickEvent = document.createEvent("MouseEvents")