Skip to content

Instantly share code, notes, and snippets.

🌈
bam boom bamdadam

Johannes Millan johannesjo

🌈
bam boom bamdadam
Block or report user

Report or block johannesjo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@johannesjo
johannesjo / table-to-json.js
Created Jun 28, 2016
Snippet to convert html table to json
View table-to-json.js
function tableToJson(table) {
var data = [];
// first row needs to be headers
var headers = [];
for (var i=0; i<table.rows[0].cells.length; i++) {
headers[i] = table.rows[0].cells[i].innerHTML.toLowerCase().replace(/ /gi,'');
}
// go through cells
@johannesjo
johannesjo / rowMachineCalc
Created Apr 9, 2015
A row machine mixin that uses css calc to ease your rowing
View rowMachineCalc
@mixin rowMachineCalc($numPerRow, $margin) {
@include clearfix();
display: block;
> * {
width: calc(#{(100% / $numPerRow)} - #{(($numPerRow - 1) * $margin)/$numPerRow});
float: left;
&:nth-child(n) {
margin-bottom: $margin;
margin-right: $margin;
}
View Changing default document root in Plesk.html
Inorder to change default document root for a domain hosted in a plesk control panel we need to create vhost.conf file in the directory in which http.include for the domain resides. Directly changing the document root entry in httpd.include causes the modification to be overwritten with default entry since plesk overwrites entries in configuration files with database entries
Entries to be put in the vhost.conf follows
DocumentRoot /path/to/your/new/root
<Directory /path/to/your/new/root>
# Put this if you really need all options?
Options Indexes ExecCGI FollowSymLinks MultiViews
AddHandler cgi-script .cgi
# are you using .htaccess files? if not, set it from all to none
AllowOverride all
You can’t perform that action at this time.