$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);
if (botCount < botCount)
this.reconnect();
}
My friend wrote this code recently
<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.
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);
}
// 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}
const setFormFlag(state){
state.formFlag ? state.formFlag = false : state.formFlag = true;
}
if (cookiesBannerHeight !== 0 && isMobile) {
style = {
top: cookiesBannerHeight === 0 ? 0 : cookiesBannerHeight
}
}
this.props.HeaderStore.setHeader(true, null, false, false, true, true,'dashboardNavigation');
scrollToEl($el.parent().parent().parent());
Someones idea of how to select an element to scroll to.... Please no.
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"
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.
/**
* Stringify a JSON object
* @param {*} value JSON value to stringify
* @returns {string} stringify JSON
*/
function stringify(value) {
var result = {};
try {
result = JSON.stringify(value);
} catch (e) {
Logger.error('Error while trying to stringify ' + e);
result = JSON.stringify(result);
}
return result;
}
Stringify a JSON object