Skip to content

Instantly share code, notes, and snippets.

View jonpecson's full-sized avatar
💻
In permanent beta: learning, improving, evolving...

John Pecson jonpecson

💻
In permanent beta: learning, improving, evolving...
View GitHub Profile
@jonpecson
jonpecson / controllers.js
Created February 25, 2015 01:38
firebase-service
app.controller('EventSignupController', function ($scope, $routeParams, EventService, AuthService) {
// Load the selected event with firebase through the eventservice
$scope.selectedEvent = EventService.events.get($routeParams.eventId);
// get user settings
$scope.user = AuthService.user;
$scope.signedIn = AuthService.signedIn;
// Message functionality
$scope.posts = EventService.posts.all($scope.selectedEvent.$id);
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');
@jonpecson
jonpecson / firebase-chat
Created December 17, 2014 02:59
Chat Example (Firebase)
<html>
<head>
<script src="https://cdn.firebase.com/js/client/2.0.4/firebase.js"></script>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'></script>
<link rel="stylesheet" type="text/css" href="/resources/tutorial/css/example.css">
</head>
<body>
<!-- CHAT MARKUP -->
<div class="example-chat l-demo-container">
@jonpecson
jonpecson / firebase-leaderboard.html
Last active December 16, 2022 12:21
Leaderboard Example (Firebase)
<html>
<head>
<script src="https://cdn.firebase.com/js/client/2.0.4/firebase.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="/resources/tutorial/css/example.css">
</head>
<body>
<div class="example-base example-leaderboard l-demo-container">
<table id="leaderboardTable">
@jonpecson
jonpecson / app.js
Created August 1, 2014 01:10 — forked from jgoux/app.js
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});