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
// npm install socket.io-client --save | |
import * as io from 'socket.io-client'; | |
socket:any | |
chat_input:string; | |
chats = []; | |
constructor(public navCtrl: NavController) { | |
this.socket = io('http://localhost:3000'); |
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
//npm install socket.io --save | |
// socket.js | |
var socket = require('socket.io'), | |
http = require('http'), | |
server = http.createServer(), | |
socket = socket.listen(server); | |
socket.on('connection', function(connection) { | |
console.log('User Connected'); |
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
import { DatePipe } from '@angular/common'; | |
let datePipe = new DatePipe('es-AR'); | |
this.miFecha = datePipe.transform(this.miFecha, 'dd/MM/yyyy'); |
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
const capitalizeString = value => value.split(" ") | |
.map(str => str.charAt(0).toUpperCase() + str.slice(1)) | |
.join(" "); | |
export { capitalizeString }; |
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
import { Component,ViewChild } from '@angular/core'; | |
import { NavController } from 'ionic-angular'; | |
@Component({ | |
selector: 'page-home', | |
templateUrl: 'home.html' | |
}) | |
export class HomePage { | |
@ViewChild('myCanvas') canvas: any; |
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
import { ViewChild } from '@angular/core'; | |
@ViewChild('myCanvas') canvas: any; | |
canvasElement: any; | |
ctx:any; | |
ngAfterViewInit(){ | |
this.canvasElement = this.canvas.nativeElement; | |
this.ctx = this.canvasElement.getContext('2d'); |
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
import { ViewChild } from '@angular/core'; | |
@ViewChild('idDelElemento') imagen: any; | |
imagenHTML: any; | |
//costructor | |
this.imagenHTML = this.imagen.nativeElement; | |
//ya puedo trabajar, por ejmeplo obteniendo el alto del contenedor | |
this.imagenHTML.height |
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
var canvas = document.getElementById('canvas'), | |
ctx = canvas.getContext('2d'); | |
canvas.width = $('img').width(); | |
canvas.crossOrigin = "Anonymous"; | |
canvas.height = $('img').height(); | |
ctx.drawImage($('img').get(0), 0, 0); | |
ctx.font = "36pt Verdana"; | |
$(document).on('input','#inp',function(){ | |
//redraw image | |
ctx.clearRect(0,0,canvas.width,canvas.height); |
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
.contenedorCentro { | |
position: absolute; | |
display: table; | |
height: 100%; | |
width: 100%; | |
text-align: center; | |
border: 2px dashed #f69c55; | |
} | |
.centrado { |
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
router.get('/email',function (req, res) { | |
var pdf = require('html-pdf'); | |
var fs = require('fs'); | |
var html = '<h3>hola</h3><p>chau</p>' | |
var transporter = nodemailer.createTransport({ | |
host: 'smtp.gmail.com', // mail.clubhonorarios.com | |
port: 587, |
OlderNewer