Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
#define GB 1024 * 1024 * 1024
int main() {
printf("hello world!\n");
printf("%d\n", GB);
let resultado = [3,5,9,40,42,47];
let validarNumerosMegaSena = (resultado, nodes) => {
for(let c of nodes) {
let n = Number.parseInt(c.textContent);
if(resultado.indexOf(n) >= 0) { c.style.backgroundColor = 'yellow' }
}
}
let nodes = document.querySelectorAll('#tabelaApostas tbody tr celula-prognostico span.margemVolante');
validarNumerosMegaSena(resultado, nodes);
@paulocanedo
paulocanedo / star.js
Created August 19, 2016 16:33
construir estrela
buildStar(x, y, radius) {
let pentagon = this.buildPolygonRegular(x, y, radius, 5);
let p0 = lineIntersection(pentagon[0], pentagon[2], pentagon[1], pentagon[4]);
let p1 = lineIntersection(pentagon[0], pentagon[2], pentagon[1], pentagon[3]);
let p2 = lineIntersection(pentagon[2], pentagon[4], pentagon[3], pentagon[1]);
let p3 = lineIntersection(pentagon[2], pentagon[4], pentagon[3], pentagon[0]);
let p4 = lineIntersection(pentagon[0], pentagon[3], pentagon[1], pentagon[4]);
let output = [];
@paulocanedo
paulocanedo / gist:564717834e6e8ae26836
Last active August 29, 2015 14:04
javascript scope
return {
filename: _filename,
find: function(id) {
js_database.forEach(function(entry) {
if(id === entry.id) {
return this.assetFromFile(entry.filename);
}
});
return null;
},
SELECT DISTINCT A.ID, A.title, A.file_path, B.Count
FROM tracks A
inner JOIN (
SELECT COUNT(*) as Count, B.title
FROM tracks B
GROUP BY B.title
) AS B ON A.title = B.title
WHERE B.Count > 1
ORDER by A.title;