Skip to content

Instantly share code, notes, and snippets.

View ahrherrera's full-sized avatar
🌙
Working

Allan Ramirez ahrherrera

🌙
Working
  • Managua, Nicaragua
View GitHub Profile
@ahrherrera
ahrherrera / page.ts
Created August 18, 2020 23:11
Para Subir imagenes a Firebase
const options : CameraOptions = {
quality: 50, // picture quality
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE ,
correctOrientation: true
}
this.camera.getPicture(options) .then((imageData) => {
let imagen = {
titulo: 'imagen deposito',
@ahrherrera
ahrherrera / principal.ts
Created December 19, 2019 19:42
Resume platform
this.platform.resume.subscribe((res) => {
if(this.resumed == false){
//your logic goes here
this.auth.getUserData().subscribe(()=>{
console.log("User updated successfully");
if (this.auth.userdata.afiliado.bloqueado) {
this.alertCtrl.create({
title: "Su usuario está bloqueado",
subTitle: "Mientras su usuario está bloqueado, no puede recibir ni aceptar órdenes. <br><br> Si cree que es un error, contáctese con soporte."
@ahrherrera
ahrherrera / cloudSettings
Last active August 10, 2020 18:20
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-10T18:20:49.173Z","extensionVersion":"v3.4.3"}
@ahrherrera
ahrherrera / router.js
Created April 26, 2019 20:49
Picture upload
const multer = require('multer');
const picStorage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, 'public/images'); // carpeta donde guardara los ficheros
},
filename: function (req, file, cb) {
cb(null, Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15) + file.originalname);
//El nombre como quedara el archivo guardaro (Aca genero un string aleatorio para en caso que no se repitan los filenames)
}
@ahrherrera
ahrherrera / file.json
Created February 25, 2019 17:39
RAW update User
{
"apt_unit": "9282727",
"city": "Managua",
"dob": "2003-02-25",
"email": "allanhavidramirez@gmail.com",
"first_name": "Allan",
"gender": 0,
"goals": null,
"last_name": "Ramirez",
"password": "allan1097",
@ahrherrera
ahrherrera / QUERY.sql
Created February 18, 2019 16:49
Search Query
--Stored Procedure: [dbo].[sp_Search]
Select
pro.id as 'ProfileID',
pro.first_name as 'FirstName',
pro.last_name as 'LastName',
pro.email as 'Email',
pro.phone as 'Phone',
sp.name as 'Sport',
pro.score as 'Score',
@ahrherrera
ahrherrera / account.js
Created February 15, 2019 23:19
Email send
const mailOptions = {
from: 'thefreeagent.app@gmail.com', // sender address
to: req.body.email, // list of receivers
subject: 'Thank you for purchasing Premium Account', // Subject line
html: `<p style="Margin-top: 0;Margin-bottom: 20px;text-align: center;"><span style="color:#000">We've charged &nbsp;<strong>$1.99</strong> to activate The Free Agent Premium account.<br /><br />- The Free Agent Team</span></p>` // plain text body
};
transporter.sendMail(mailOptions, function(err, info) {
if (err)
console.log(err);
export const SERVER_URL = 'https://free-agent-api.e2api.com';
// export const SERVER_URL = 'http://localhost:9000';
export const states = [
{
"name": "Alabama",
"abbreviation": "AL"
},
{
"name": "Alaska",
@ahrherrera
ahrherrera / app.js
Last active February 5, 2019 20:27
Multer file upload
var express = require("express");
var router = express.Router();
var accountModel = require("../models/account/account"); // gf
const multer = require('multer');
// FileUpload Setup
const storage = multer.diskStorage({
destination: function(req, file, cb) {
//Directorio donde guardar imagen