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
function getGeoCenter(data) { | |
const coordLength = data.length; | |
let x = 0; | |
let y = 0; | |
let z = 0; | |
for (const item of data) { | |
const lat = item.lat * Math.PI / 180; | |
const lon = item.lng * Math.PI / 180; |
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
const boundingREct = new H.geo.Rect(boundingBox.northEast.lat, boundingBox.northEast.lng, boundingBox.southWest.lat, boundingBox.southWest.lng); | |
this.map.addObject( | |
new H.map.Rect(boundingREct, { | |
style: { | |
// fillColor: '#FFFFCC', | |
strokeColor: '#E8FA75', | |
lineWidth: 2 | |
}, | |
}) | |
); |
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
#!/bin/bash | |
protected_branch='master' | |
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
if [ $protected_branch = $current_branch ] | |
then | |
read -p "You're about to push $protected_branch, is that what you intended? [y|n] " -n 1 -r < /dev/tty | |
echo | |
if echo $REPLY | grep -E '^[Yy]$' > /dev/null |
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
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 |
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
@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; | |
} |
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
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 |