This file contains hidden or 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 gulp = require('gulp'); | |
| var browserSync = require('browser-sync').create(); | |
| var sass = require('gulp-sass'); | |
| sass.compiler = require('node-sass'); | |
| gulp.task('sass', function () { | |
| return gulp.src('./sass/**/*.scss') | |
| .pipe(sass.sync().on('error', sass.logError)) | |
| .pipe(gulp.dest('./app/dist/css')); |
This file contains hidden or 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
| import React, { useState, useEffect } from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| /* Esta função pode estar em outro arquivo */ | |
| async function getDados(){ | |
| let response = await fetch('/api/dados') | |
| let resposta = await response.json(); | |
| return resposta; | |
| } |
This file contains hidden or 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
| -- execute on client query command | |
| set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; | |
| set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; |
This file contains hidden or 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
| Use n module from npm in order to upgrade node | |
| sudo npm cache clean -f | |
| sudo npm install -g n | |
| sudo n stable |
This file contains hidden or 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 nbtls_gt(){ | |
| if( typeof nbttimer == "undefined" ) | |
| return new Date().getTime() | |
| else | |
| return new Date().getTime() - nbttimer | |
| } | |
| var nbttimer = nbtls_gt(); // initialize timer |
This file contains hidden or 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
| new AlertDialog.Builder(this) | |
| .setTitle("Atenção!") | |
| .setMessage("Deseja remover " + funcionario.getNome() + " ?") | |
| .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener(){ | |
| @Override | |
| public void onClick(DialogInterface dialog, int which) { | |
| funcionario.delete(); | |
| Sair(); | |
| } |
This file contains hidden or 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 pastaDlg = Folder.selectDialog (); // Abrir Caixa de dialogo para selcionar a pasta | |
| //var pastaDlg = new Folder('c:/Users/Ricardo/Documents/_teste'); // se quiser digitar o endereço dentro do script, comente a linha de cima e descomente essa | |
| if(pastaDlg){ // se foi selecionado uma pasta, não foi clicado em 'cancelar' | |
| var pastaOrigem = pastaDlg.getFiles ('*.jpg'); // obter array de arquivos, apenas jpg | |
| var pastaDestino = new Folder (pastaDlg.fullName + '/th'); // Objeto que representa a pasta de destino | |
| if(!pastaDestino.exists) pastaDestino.create(); // Comando para criar a pasta fisicamente | |
| preferences.rulerUnits = Units.PIXELS; //Converter a unidade padrão para pixels | |
| var jpegOptions = new JPEGSaveOptions(); // Criar objeto de opções para salvar em JPEG | |
| jpegOptions.quality = 5; // Qualidade da imagem, de 1 a 12 | |
| jpegOptions.embedColorProfile = true; |
This file contains hidden or 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
| // Lista de locais e produtos | |
| ArrayList<String> produtos = ods.ListaProduto(); | |
| // Preencher os ListViews | |
| ArrayAdapter<String> adapterLocal = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, produtos); | |
| lstLocais.setAdapter(adapterLocal); // ListView ou ExpandableListView |
This file contains hidden or 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
| // Uso: | |
| // Declarar um objeto TextWatcher | |
| // O valor do TextWatcher é o retorno da função Mask.insert, com dois parametros: string com o formato da mascara e a caixa de texto que irá receber a mascara | |
| // ou o retorno da função Mask.monetario, apenas com a caixa de texto que será receberá o valor monetario | |
| // Adicionar na caixa de texto o evento TextWatcher | |
| // Ex: | |
| // TextWatcher cpfMask = Mask.insert("###.###.###-##, editCpf); | |
| // cpfMask.addTextChangedListener(editCpf) | |
| // TextWatcher salarioMask = Mask.monetario(editSalario); | |
| // salarioMask.addTextChangedListener(editSalario); |
This file contains hidden or 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
| public class OperacaoDS { | |
| private Banco dbHelper; | |
| private SQLiteDatabase database; | |
| public final static String OPERACAO = "operacao"; // name of table | |
| public final static String ID = "id"; | |
| public final static String LOCAL = "local"; | |
| public final static String PRODUTO = "produto"; |
NewerOlder