Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Jose Tandavala tandavala

🎯
Focusing
View GitHub Profile
View mongoose filtering list
router.route('/fetchdata').get(function(req,res){
employees.find( {{"age" : {$gt : 25}}, function(err, result){
if(err){
res.send(err)
}
else{
View print3largestsNumber
function print3largest(array, size){
let i, first, second, third;
if(size < 3){
throw new Error("Invalid Input");
return;
}
third = first = second = Number.MIN_VALUE;
for(i =0; i < size; i++){
// If current element is greater than frist
View mongoose findOneOrCreate solution
pageSchema.statics.findOneOrCreate = function findOneOrCreate(condition, doc, callback) {
const self = this;
self.findOne(condition, (err, result) => {
return result
? callback(err, result)
: self.create(doc, (err, result) => {
return callback(err, result);
});
});
@tandavala
tandavala / node-sass.md
Last active Oct 26, 2019
Como usar sass com node js
View node-sass.md

node-sass

Sass é uma linguagem de script que é interpretada ou compilada em Cascading Style Sheets (CSS). e neste GIST estarei demonstrando como usar sass com node js.

Primeiro passo

Iniciar um projecto do zero com a framework express

mkdir node_sass
@tandavala
tandavala / lektor.md
Last active Oct 19, 2019
Configurando Lektor com uma pagina do github e travis cs
View lektor.md

Passo a passo para configurar o lektor com uma pagina do github e travis ci

Este passo a passo assume que já tenhas o lekto instalado caso contrario podes instalar o lektor seguindo a documentação neste link

@tandavala
tandavala / calc-rem.js
Created Jul 20, 2019 — forked from daniellmb/calc-rem.js
PX-to-REM Calculator
View calc-rem.js
(function($) {
var result = $('#result');
var base = $('#base');
var list = $('#list');
$('#calc').click(function() {
var baseVal = base.val();
var px = list.val().split(',');
var html = [];
$.each(px, function(i, v) {
var px = parseInt(v);
@tandavala
tandavala / starUML.md
Created Jul 11, 2018 — forked from trandaison/starUML.md
Get full version of StarUML
View starUML.md

StarUML

Download: StarUML.io

Crack

Source: jorgeancal

After installing StartUML successfully, modify LicenseManagerDomain.js as follow:

/**
You can’t perform that action at this time.