textillate.js - pause between slides - slide

i have a simple textillate box with 5 slides.
How can i set a pause between the slides ?
My code:
$('.textslide').textillate({
loop: true,
minDisplayTime: 4000,
initialDelay: 1500,
inEffects: ['fadeInLeft'],
outEffects: ['fadeOut'],
in: {
effect: 'fadeInLeft',
sync: true,
delay: 500
},
out: {
effect: 'fadeOutRight',
sync: true,
delay: 500
},
type: 'char',
autoStart: true
})

Related

Issue with line width prittier/eslint airbnb styleguide

I am running into an issue where I can not get my printWidth settings to change. Regardless, of what value I put I can not get the printWidth settings to reflect.
Has anyone run into this before or see any glaring errors in my config files:
prittierrc.js
module.exports = {
printWidth: 500,
singleQuote: true,
trailingComma: 'all',
};
eslintrc.js
const { off } = require('process');
module.exports = {
extends: ['airbnb', 'plugin:prettier/recommended', 'prettier/react'],
env: {
browser: true,
commonjs: true,
es6: true,
jest: true,
node: true,
},
rules: {
'jsx-a11y/href-no-hash': ['off'],
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx'] }],
'max-len': [
'warn',
{
code: 500,
tabWidth: 2,
comments: 250,
ignoreComments: false,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'no-unused-vars': 'warn',
'no-console': 'off',
},
};
how my editor looks:
click here for imgur url
Its clearly not reflecting the printWidth: 500 setting
Check the spelling on you config file name.

Highcharts export server does not export labels

Demo: https://jsfiddle.net/L6ca89dh/4/
When I export (click the hamburger and click export SVG) the Data-Labels display fine.
When I use my highcharts-export-server they do not:
*** This is how is is supposed to look:
Code snippet of chart item
var chart = {
title: {
text: null
},
time: {
useUTC: false
},
chart: {
width: 1200,
height: 600,
plotBackgroundColor: null,
plotBorderWidth: 0,
plotShadow: false,
spacing: 0,
type: 'spline'
},
xAxis: {
//startOnTick: true
},
yAxis: {
title: {
text: 'Performance (%)'
},
//min: 0
},
legend: {
enabled: true,
navigation: false,
itemStyle: {"fontSize": "11px", "fontWeight": "normal"}
},
rangeSelector: {
enabled: false
},
scrollbar: {
enabled: false
},
navigator: {
enabled: false
},
credits: {
enabled: false
},
plotOptions: {
spline: {
compare: 'percent',
marker: {
enabled: true
}
},
},
series: series
};
Do you mean that series labels are not visible on an exported image when using node export server (https://github.com/highcharts/node-export-server) on your side? If so, the reason behind it is because the series-label script (https://code.highcharts.com/modules/series-label.js) isn't included among other additional scripts (such as xrange) in the build.js file. All you need to do is to add the following:
'{{version}}/modules/series-label.js': 1
inside the cdnScriptsOptional array and run node build.js. For more information you can visit repo of the exporting server (https://github.com/highcharts/node-export-server).

what the differences in mongoDB strategy field in replicaSet

From what I have read there are 3 options : "ping" and "strategy" and a default as null.
Can someone explain what are the differences between them ?
I am using secondary preferred so whom should I pick based the fact all my servers are in the same data center ?
When I chose "ping" I see that most of the reading goes only to one secondary (and I have more then 1)
So what am I missing ?
Here is my configuration :
dbOptions: {
db: {
readPreference: 'secondaryPreferred'
},
server: {
socketOptions: {
keepAlive: 1000,
connectTimeoutMS: 30000
},
readPreference: 'secondaryPreferred',
strategy: 'ping'
},
replset: {
socketOptions: {
keepAlive: 1000,
connectTimeoutMS: 30000
},
rs_name: 'test',
readPreference: 'secondaryPreferred',
strategy: 'ping'
}
}

jqGrid export to excel issue when loadonce option is setted to false

I have an ASP.net MVC solution and use jqGrid in it. To have a better performance I use loadonce: false as an option and it should be in this way, unfortunately It seems to be not supported by jqGrid because I cannot find any sign of that throughout my search.
$(document).ready(function () {
$("#jqGrid").jqGrid(
{
url: "/Student/GetStudents",
mtype: "GET",
datatype: "json",
contentType: "application/json; charset-utf-8",
jsonReader: {
root: "rows",
id: "StudentId",
repeatitems: false
},
colNames: ['StudentId', 'FirstName', 'LastName'],
colModel: [
{ label: 'StudentId', name: 'Id', key: true, width: 75 },
{ label: 'FirstName', name: 'FirstName', width: 150 },
{ label: 'LastName', name: 'LastName', width: 150 },
],
viewrecords: true,
loadonce: false,
width: '100%',
height: 'auto',
rowNum: 20,
rowList: [20, 30, 50],
sortable: true,
sortname: 'Id',
pager: "#jqGridPager",
autoencode: true,
scroll: false,
pgbuttons: true,
autowidth: true,
shrinkToFit: false,
forceFit: false,
gridview: false,
height: '100%',
scrollrows: true,
page: 1,
//pagerpos: 'center',
toppager: true,
recordpos: 'right',
multiselect: true,
multiboxonly: true,
direction: 'rtl',
ignoreCase: true,
caption: "",
rownumbers: true
});
$('#jqGrid').jqGrid('navGrid', '#jqGridPager', {
search: true,
searchtext: "Search",
edit: false,
add: false,
del: false,
excel: true,
refresh: false,
}, {}, {}, {}, {
closeOnEscape: true,
closeAfterSearch: true,
ignoreCase: true,
multipleSearch: false,
multipleGroup: false,
showQuery: false,
sopt: ['cn', 'eq', 'ne'],
defaultSearch: 'cn'
})
$('#jqGrid').jqGrid('navButtonAdd', '#jqGridPager', {
caption: "Export to Excel",
//buttonicon: "ui-icon-disk",
buttonicon: "ui-icon-folder-open",
onClickButton: function () {
exportToExcel();
},
});
});
function exportToExcel(data, e) {
exportExcelFile(data);
}
function exportExcelFile() {
debugger;
var data = $('#jqGrid')[0].addLocalData(true);
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
frame1.document.open("txt/html", "replace");
frame1.document.write(setTableOfData(data));
frame1.document.close();
frame1.focus();
sa = frame1.document.execCommand("SaveAs", true, "text.xls");
} else
$('#jqGrid').jqGrid('exportToExcel', { fileName: "exportedExcel.xls", navigator: true });
}
function setTableOfData(data) {
var htmlString = '<table>';
var header = '<tr><td>StudentId</td><td>FirstName</td><td>LastName</td></tr>';
htmlString += header;
for (var i = 0; i < data.length; i++) {
var tag = '<tr><td>' + data[i].Id + '</td><td>' + data[i].FirstName + '</td><td>' + data[i].LastName + '</td></tr>';
htmlString += tag;
}
htmlString += '</table>';
return htmlString;
}
Finally, I forced to post all the filtering and other settings of the grid to the server and return a link to the client. Then with the given link I became able to download the excel file.
Info: you can not download a file with post(ajax) request.

How can we run the node-cron job in every 12 hours interval?

I want to schedule the email after every 12 hrs , For that I have used node-cron.
I have used the following code but its not giving me actual result, so please help me to resolve this issue,
var job = new CronJob('0 0 */12 * * *', function(){
//email send code ..
});
Looking at the documentation the code should look like this:
var cron = require('node-cron');
cron.schedule('0 0 */12 * * *', function(){
console.log('running a task every twelve hours');
});
Note: You need to have the app running all the time or the cron won't be executed.
And If you print the crone time on console the we wil get like as follows :
cronTime: {
source: '0 0 */12 * * *',
zone: 'America/Los_Angeles',
second: {
'0': true
},
minute: {
'0': true
},
hour: {
'0': true,
'12': true
},
dayOfMonth: {
'1': true,
'2': true,
'3': true,
'4': true,
'5': true,
'6': true,
'7': true,
'8': true,
'9': true,
'10': true,
'11': true,
'12': true,
'13': true,
'14': true,
'15': true,
'16': true,
'17': true,
'18': true,
'19': true,
'20': true,
'21': true,
'22': true,
'23': true,
'24': true,
'25': true,
'26': true,
'27': true,
'28': true,
'29': true,
'30': true,
'31': true
},
month: {
'0': true,
'1': true,
'2': true,
'3': true,
'4': true,
'5': true,
'6': true,
'7': true,
'8': true,
'9': true,
'10': true,
'11': true
},
dayOfWeek: {
'0': true,
'1': true,
'2': true,
'3': true,
'4': true,
'5': true,
'6': true
}
},
You can try this module https://www.npmjs.com/package/node-schedule
var schedule = require('node-schedule');
var rule = new schedule.RecurrenceRule();
var j = schedule.scheduleJob('1 * * * * *', function(){
console.log('Will run after every mint');
});
var rule = new schedule.RecurrenceRule();
rule.second=1;
var j = schedule.scheduleJob(rule, function(){
console.log('this will run after every one seocnd ');
});
Try this for 12 hours interval ...
var job = new CronJob('0 0 12 * * *', function(){
//email send code ..
});
0 --> for seconds
0 --> for minutes
12--> for 12 hours interval

Resources