scrollToEl($el.parent().parent().parent());
Someones idea of how to select an element to scroll to.... Please no.
socket.on('newMessage', (messageObj) => {
if (roomNumber === messageObj.roomNumber) {
console.log("message received:" + messageObj.message);
$('#messages').append($('<li>').text(messageObj.userName + ' : ' + messageObj.message));
}
});
socket.in wasn't behaving as advertised (broadcasting to all rooms). I decided to take matters into my own hands.
let verificaAdmin_Role = (req, res, next) => {
let usuario = req.usuario;
if (usuario.role === 'ADMIN_ROLE') {
next();
} else {
return res.status(409).json({
ok: false,
err: {
message: 'El usuario no es administrador.'
}
})
}
};
He's our company CTO, with 25+ years of experience. Author https://github.com/juang77"
this.props.HeaderStore.setHeader(true, null, false, false, true, true,'dashboardNavigation');
const setFormFlag(state){
state.formFlag ? state.formFlag = false : state.formFlag = true;
}
// powtierdzenie decyzji
function zapytaj(pytanie){
if(confirm(pytanie)) return true
else return false;
}
roots.push(resolver(Config.root, `${pageDir}${path.sep}${page}${path.sep}${page}.html`));
class Timer extends React.Component{
state ={
time: 10
};
setInvt = () =>{
let t = this.state.time
if(t<=1){
clearInterval(this.invertal)
}
this.setState({time: t-1})
}
componentDidMount(){
this.invertal = setInterval(this.setInvt, 1000)
}
render(){
return (<label>{this.state.time}</label>)
}
}
export {Timer}
class FileReader extends EventTarget(...READER_EVENTS) {
// [...]
readAsArrayBuffer() {
throw new Error('FileReader.readAsArrayBuffer is not implemented');
}
}
React Native's way of saying they don't support FileReader.readAsArrayBuffer()
// What they did:
var serverCommands = {};
for(var each in commandList.general)
(dmCommands[commandList.general[each].type] ? dmCommands[commandList.general[each].type] +=
(config.prefix + each + (commandList.general[each].args ? ' ' + commandList.general[each].args : '') +
': ' + commandList.general[each].description + '\n') : (dmCommands[commandList.general[each].type] =
'\u200B'+ config.prefix + each + (commandList.general[each].args ? ' ' + commandList.general[each].args : '') +
': ' + commandList.general[each].description + '\n'))
// What they should've done:
let srvrCmds = new Map();
let gldCmds = commandList[message.guild.id];
for (let each in gldCmds) {
const cur = gldCmds[each];
const text = `${config.prefix + each + (cur.args ? " " + cur.args : "")}: ${cur.description}\n`;
const srvrCmdType = srvrCmds.get(cur.type);
srvrCmds.set(cur.type, (srvrCmdType || "\u200B") + text);
}
<div class="scrollContent">
{foreach $animations as $index => $a}
{if $index > 2}
{if $a.filename == '9_1447691013_3726.png'}
{else}
{if $a.filename == '9_1423150010_6441.png'}
{else}
{if $a.filename == '9_1423149959_5909.png'}
{else}
{if $a.filename == '9_1423149908_5874.png'}
{else}
{if $a.filename == '9_1528213223_6374.jpg'}
{else}
{if $a.filename == '9_1527670984_3732.jpg'}
{else}
<div class="spotlightFrame frame{$index+1} contains1" data-index="{$index}">
{if $a.link}<a href="{$a.link}">{/if}
<img src="/upload/{$a.filename}" alt="{$a.title}" />
{if $a.link}</a>{/if}
</div>
{/if}
{/if}
{/if}
{/if}
{/if}
{/if}
{/if}
{/foreach}
</div>
Handovers are great.
$options.splice($options.indexOf('option7'), 1);
$options.splice($options.indexOf('option5'), 1);
$options.splice($options.indexOf('option4'), 1);
$options.splice($options.indexOf('option3'), 1);
$options.splice($options.indexOf('option2'), 1);
$options.splice($options.indexOf('option1'), 1);
$(document).on('click', '.edit-item', function(event) {
let row_id = event.currentTarget.attributes['data-row'].value,
data = dataIndex[
dataIndex.findIndex(i => i.id === Number(row_id))
];
$('.modal-body div:nth-child(1) input').attr('value', data.name)
$('.modal-body div:nth-child(2) input').attr('value', data.category)
$('.modal-body div:nth-child(3) #basicSelect').val(data.status)
$('.modal-body div:nth-child(4) input').attr('value', data.price)
$('.modal-body div:nth-child(5) input').attr('value', data.bju.mass)
$('.modal-body div:nth-child(6) input').attr('value', data.bju.calories)
$('.modal-body div:nth-child(7) input').attr('value', data.bju.proteins)
$('.modal-body div:nth-child(8) input').attr('value', data.bju.fats)
$('.modal-body div:nth-child(9) input').attr('value', data.bju.carbohydrates)
}
)
if (botCount < botCount)
this.reconnect();
}
My friend wrote this code recently
const convertMenu = menus => {
const menusAssinged = menus.filter(menu => menu.parentId == null).sort((a, b) => a.order - b.order).map(menu => {
if (menus.some(element => element.parentId == menu.menuId)) {
return {
title: menu.title,
icon: { icon: menu.icon },
children: menus.filter(menuChil => menuChil.parentId == menu.menuId).sort((a, b) => a.order - b.order).map(menuChil => {
if (menuChil.pathRoute.includes(":")) {
const params = menuChil.pathRoute.split(":").pop()
return {
title: menuChil.title,
to: { name: menuChil.nameRoute, params: { [params]: "abc" } },
}
} else {
return {
title: menuChil.title,
to: menuChil.nameRoute,
}
}
}),
}
} else {
return {
title: menu.title,
icon: { icon: menu.icon },
to: menu.nameRoute,
}
}
})
menusUser.value = menusAssinged
localStorage.setItem('menus', JSON.stringify(menusAssinged))
}
when they exorcise the callbacks demon but they appear in functional