This file contains 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
/* FIRST AND LAST DAY OF WEEK */ | |
var curr = new Date; // get current date | |
var first = curr.getDate() - curr.getDay(); // First day is the day of the month - the day of the week | |
var last = first + 6; // last day is the first day + 6 | |
var firstday = new Date(curr.setDate(first)).toUTCString(); | |
var lastday = new Date(curr.setDate(last)).toUTCString(); | |
/* TOMORROW */ | |
var tomorrow = new Date(); |
This file contains 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
var table; | |
var perguntas = []; | |
var codigoPerg = 0; | |
var acoes = '<i class="fa fa-arrow-up fa-lg praCima"></i> <i class="fa fa-arrow-down fa-lg praBaixo"></i> <i class="fa fa-pencil fa-lg editar" title="' + Resources.EDITAR + '"></i> <i class="fa fa-trash-o fa-lg remover" style="color: #ff0000" title="' + Resources.REMOVER +'"></i>'; | |
function updateTablePerguntas() { | |
table.clear(); | |
perguntas.sort(function (a, b) { return a.Ordem - b.Ordem; }); | |
table.rows.add(perguntas).draw(); | |
} |
This file contains 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
String.prototype.replaceAll = function(search, replacement) { | |
var target = this; | |
return target.replace(new RegExp(search, 'g'), replacement); | |
}; | |
var str = "oi, tchau, adios, bye, etc"; | |
str.toString().replaceAll(',','\n'); |
This file contains 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
<div class="col-lg-offset-3 col-md-offset-3 col-sm-offset-3 col-md-10"> | |
</div> |
This file contains 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 timeout = ms => new Promise((resolve, reject) => | |
setTimeout(reject, ms, { timeout: true }); | |
); | |
Promise.race([api.get('/users/diego3g'), timeout(2000)]) | |
.then(resp => console.log(resp)) | |
.catch(err => console.log(err)); |
This file contains 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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// Choose either "stable" for receiving highly polished, | |
// or "canary" for less polished but more frequent updates | |
updateChannel: 'stable', |
This file contains 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
let interval; | |
const blink = () => { | |
interval = setInterval(() => $('.cursor').toggle(), 600); | |
}; | |
const stopBlinking = () => { | |
clearInterval(interval); | |
} |
This file contains 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 getMonday(d) { | |
d = new Date(d); | |
var day = d.getDay(), | |
diff = d.getDate() - day + (day == 0 ? -6 : 1); // adjust when day is sunday | |
return new Date(d.setDate(diff)); | |
} |
This file contains 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
/** | |
* @param {string} str : multiline string | |
* @return {string} result | |
*/ | |
function genProps(str){ | |
let arr = str.split('\n'); | |
let ini = 'public string '; | |
let fim = ' {get;set;}\n'; | |
return ini+ arr.join(fim + ini) + fim; | |
} |
OlderNewer