Skip to content

Instantly share code, notes, and snippets.

Frank van Puffelen puf

Block or report user

Report or block puf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View README.md

Firebase Hosting Deploy Single File

This utility script deploy a single local file to an existing Firebase Hosting site. Other files that are already deployed are left unmodified.

The difference with firebase deploy is that this script does not require you to have a local snapshot of all hosted files, you just need the one file that you want to add/update.

USE AT YOUR OWN RISK. NO WARRANTY IS PROVIDED.

@puf
puf / index.html
Last active Nov 16, 2018
Zero to App: Develop with Firebase (for Web - Google I/O 2016)
View index.html
<html>
<head>
<script src="https://www.gstatic.com/firebasejs/3.0.0/firebase.js"></script>
<title>ZeroToApp</title>
<style>
#messages { width: 40em; border: 1px solid grey; min-height: 20em; }
#messages img { max-width: 240px; max-height: 160px; display: block; }
#header { position: fixed; top: 0; background-color: white; }
.push { margin-bottom: 2em; }
@keyframes yellow-fade { 0% {background: #f2f2b8;} 100% {background: none;} }
@puf
puf / ChatMessage.java
Last active Jul 16, 2019
Zero to App: Develop with Firebase (for Android - Google I/O 2016)
View ChatMessage.java
package com.google.firebase.zerotoapp;
public class ChatMessage {
public String name;
public String message;
public ChatMessage() {
}
public ChatMessage(String name, String message) {
@puf
puf / WaitForInitialValue.java
Last active Mar 3, 2018
Waiting for an initial value
View WaitForInitialValue.java
public class Main {
static ValueEventListener mListener;
public static void main(String[] args) throws Exception {
Firebase ref = new Firebase("https://<your-app>.firebaseio.com/");
mListener = ref.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
if (snapshot.exists()) {
System.out.println("The value is now "+snapshot.getValue());
@puf
puf / acknowledge.js
Created Jan 26, 2016
Account merging
View acknowledge.js
var ref = new Firebase('https://yours.firebaseio.com/acknowledge');
var users = [];
function $(selector) {
var result = document.querySelectorAll(selector);
return (result.length > 1) ? Array.prototype.slice.call(result) : result[0];
}
function handleAuthResult(error, authData) {
if (error) {
@puf
puf / index.android.js
Created Dec 14, 2015
Simple example of a React Native chat app for Android (using Firebase and ReactFire)
View index.android.js
'use strict';
var React = require('react-native');
var Firebase = require('firebase');
var ReactFireMixin = require('reactfire');
var {
AppRegistry,
StyleSheet,
Text,
View,
@puf
puf / index.android.js
Created Dec 14, 2015
Simple example of a React Native chat app for Android (using Firebase)
View index.android.js
'use strict';
var React = require('react-native');
var Firebase = require('firebase');
var {
AppRegistry,
StyleSheet,
Text,
View,
TextInput,
@puf
puf / gist:c7b0612b6ffbb5f6b1cd
Last active Aug 29, 2015
Create a Firebase email/password user in Java
View gist:c7b0612b6ffbb5f6b1cd
new Firebase("https://yours.firebaseio.com/").createUser("user@domain.com", "password", new Firebase.ValueResultHandler<java.util.Map<String, Object>>() {
public void onSuccess(java.util.Map result) {
System.out.println("Successfully created user account with uid: " + result.get("uid"));
}
public void onError(com.firebase.client.FirebaseError firebaseError) {
System.err.ptinln("Error while creating user " + firebaseError);
}
});
@puf
puf / index.html
Last active Aug 29, 2015
Chord chart with mail volumes
View index.html
<html>
<head>
<style>
body {
font: 10px sans-serif;
}
.chord path {
fill-opacity: .67;
stroke: #000;
View Frank.tcx.json
{"TrainingCenterDatabase":{
"Activities":{
"Activity":{
"@Sport":"Biking",
"Id":"2014-06-27T21:09:29Z",
"Lap":{
"@StartTime":"2014-06-27T21:09:29Z",
"TotalTimeSeconds":"1334",
"DistanceMeters":"10702.6",
"MaximumSpeed":"19.416",
You can’t perform that action at this time.