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
#!/usr/bin/env node | |
var del = require('del'); | |
var fs = require('fs'); | |
var path = require('path'); | |
// Diretório para excluir | |
var diretorio = 'platforms/android/assets/www/bower_components/'; | |
function verificarDiretorio(diretorio, expressaoRegular, callback){ |
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
// Cria um objeto | |
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB; | |
// Abre (ou cria) o banco | |
var open = indexedDB.open("Freeburguer", 1); | |
// Cria o esquema | |
open.onupgradeneeded = function() { | |
var db = open.result; | |
var store = db.createObjectStore("lanches", {keyPath: "id"}); |
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
<?php | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
function createImage($filename){ | |
$pathinfo = pathinfo($filename); | |
$info = getimagesize($filename); |
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() { | |
angular.module('app').factory('firebaseTool', firebaseTool); | |
function firebaseTool(){ | |
var service = {}; | |
service.create = function(url, objeto){ | |
var nova_chave = firebase.database().ref().child(url).push().key; |
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
.truncate-link { | |
max-width: 100%; | |
display: inline-block; | |
vertical-align: middle; | |
overflow: hidden; | |
white-space: nowrap; | |
text-overflow: ellipsis; | |
} |
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
// Valores da imagem original | |
var width = 600, height = 300; | |
// Redução desejada | |
var width_new = 300; | |
// Novo tamanho baseado na redução | |
var height_new = Math.round(((height/width) * width_new)); |
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
.offline-alert{ | |
position: fixed; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
z-index: 28; | |
background: rgba(255, 255, 255, 0.95); | |
display: flex; | |
justify-content: center; |
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
// Realiza a busca na plataforma Firebase | |
function encontrar(uid){ | |
// Inicializa | |
var db = firebase.database(); | |
// Busca a referencia, entenda como uma URL, empresas no Firebase é representando por /empresas | |
var empresas = db.ref('empresas'); | |
// Prepara a busca filtrando |
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
.spinner { | |
width: 40px; | |
height: 40px; | |
position: relative; | |
margin: 100px auto; | |
} | |
.double-bounce1, .double-bounce2 { | |
width: 100%; | |
height: 100%; |
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
// Fica escutando o evento do botão voltar | |
// //////////////////////// | |
document.addEventListener("backbutton", function(){ | |
// Se estou na home, então pergunto se quer sair do app | |
if ($location.path() == '/'){ | |
// Mando uma mensagem na cara do usuário, perguntando se quer sair | |
$cordovaDialogs.confirm('' , 'Deseja sair do aplicativo?', ['Sim','Não']).then(function(buttonIndex) { |