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 functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
exports.addDate = functions.firestore.document('users/{userId}') | |
.onCreate(async (snapshot, context) => { | |
try { | |
return await admin.firestore().doc(snapshot.ref.path) | |
.update({ | |
createdAt: 'today' |
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 } from '@angular/core'; | |
import { GooglePlus } from '@ionic-native/google-plus/ngx'; | |
@Component({ | |
selector: 'app-home', | |
templateUrl: 'home.page.html', | |
styleUrls: ['home.page.scss'], | |
}) | |
export class HomePage { |
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 'package:flutter/material.dart'; | |
import 'package:rating_dialog/src/widgets/rating_dialog.dart'; | |
class HomePage extends StatefulWidget { | |
@override | |
_HomePageState createState() => _HomePageState(); | |
} | |
class _HomePageState extends State<HomePage> { | |
@override |
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 'package:flutter/material.dart'; | |
import 'package:rating_dialog/src/screens/home_screen.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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 'package:flutter/material.dart'; | |
class RatingDialog extends StatefulWidget { | |
@override | |
_RatingDialogState createState() => _RatingDialogState(); | |
} | |
class _RatingDialogState extends State<RatingDialog> { | |
int _stars = 0; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Logging; | |
namespace UploadAPI.Controllers | |
{ |
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
<form id="upload_form" enctype="multipart/form-data" method="post"> | |
<input type="file" name="file1" id="file1"><br> | |
<progress id="progressBar" value="0" max="100" style="width:300px;"></progress> | |
<h3 id="status"></h3> | |
<p id="loaded_n_total"></p> | |
<hr /> | |
<button type="submit">Enviar arquivo</button> | |
</form> |
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 _(el) { | |
return document.getElementById(el); | |
} | |
function uploadFile() { | |
var file = _("file1").files[0]; | |
// alert(file.name+" | "+file.size+" | "+file.type); | |
var formdata = new FormData(); | |
formdata.append("file", file, "video.mov"); | |
var ajax = new XMLHttpRequest(); |
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
<template> | |
<main> | |
<h2>VueJS File Upload</h2> | |
<form @submit="sendFile($event)" id="upload_form" enctype="multipart/form-data" method="post"> | |
<input ref="inputFile" type="file" name="file1" id="file1"><br> | |
<progress ref="progressBar" id="progressBar" value="0" max="100" style="width:300px;"></progress> | |
<h3 id="status">{{ status }}</h3> | |
<p id="loaded_n_total">{{ progressText }}</p> | |
<hr /> | |
<button type="submit">Enviar arquivo</button> |
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
<h2>Angular File Upload</h2> | |
<form (submit)="sendFile()" id="upload_form" enctype="multipart/form-data" method="post"> | |
<input #inputFile type="file" name="file1" id="file1"><br> | |
<progress #progressBar id="progressBar" value="0" max="100" style="width:300px;"></progress> | |
<h3 id="status">{{ status }}</h3> | |
<p id="loaded_n_total">{{ uploadStatus }}</p> | |
<hr /> | |
<button type="submit">Enviar arquivo</button> | |
</form> |