Skip to content

Instantly share code, notes, and snippets.

View tandavala's full-sized avatar
:octocat:
Fork my code is Free

Jose Tandavala tandavala

:octocat:
Fork my code is Free
View GitHub Profile
class ProcessarPagamento {
private bulk: number;
private empresa: number;
private totalToPay: number;
private moeda: string;
constructor(bulk: number, empresa: number, totalToPay: number, moeda: string) {
this.bulk = bulk;
this.empresa = empresa;
this.totalToPay = totalToPay;
'use strict'
/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')
class RecibosSchema extends Schema {
up () {
this.create('recibos', (table) => {
table.increments()
table.integer('numero').notNullable();
'use strict';
const Factory = use('Factory');
const { test, trait } = use('Test/Suite')('Thread');
const Thread = use('App/Models/Thread');
trait('Auth/Client');
trait('Test/ApiClient');
trait('DatabaseTransactions');
@tandavala
tandavala / docker-compose.yml
Created March 17, 2021 14:57 — forked from aedorado/docker-compose.yml
Docker compose file for ELK 7.9.2
version: '3.7'
services:
elasticsearch:
image: elasticsearch:7.9.2
ports:
- '9200:9200'
environment:
- discovery.type=single-node
ulimits:
const unix_timestamp = 610329600000;
const date = new Date(unix_timestamp);
const calculate_age = (dob) => {
const diff_ms = Date.now() - dob.getTime();
const age_dt = new Date(diff_ms);
return Math.abs(age_dt.getUTCFullYear() - 1970);
};
router.route('/fetchdata').get(function(req,res){
employees.find( {{"age" : {$gt : 25}}, function(err, result){
if(err){
res.send(err)
}
else{
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
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 April 12, 2022 00:51
Como usar sass com node js

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 October 19, 2019 08:30
Configurando Lektor com uma pagina do github e travis cs

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