Skip to content

Instantly share code, notes, and snippets.

View Yogatopia's full-sized avatar
👨‍💻
Coding

Armand Lacle Yogatopia

👨‍💻
Coding
  • The Hague, Netherlands
View GitHub Profile
@Yogatopia
Yogatopia / Index.html
Last active October 5, 2015 15:07
Instafeed.js
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<title>Instagram.js</title>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="node_modules/instafeed.js/instafeed.min.js"></script>
<style>
@Yogatopia
Yogatopia / 0firebase_functions_cheatsheet.js
Created April 20, 2017 08:23
firebase_functions_cheatsheet.js
// Core
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
const db = admin.database();
admin.auth().createUser({
uid: uid,
displayName: displayName,
photoURL: photoURL
@Yogatopia
Yogatopia / index.js
Created April 20, 2017 11:38
Cloud Function for Push Notification
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
/**
* Triggers when new subject added in the list and sends a notification.
*/
exports.sendNotification = functions.database.ref('/subjects/{subjectKey}').onWrite((event) => {
@Yogatopia
Yogatopia / app.js
Created April 20, 2017 11:42
AppServer code for Push Notification
var firebase = require('firebase-admin');
var request = require('request');
// Fetch the service account key JSON file contents
var serviceAccount = require("path/to/serviceAccountKey.json");
var env = require("path/to/env.json");
// Your Firebase Cloud Messaging Server API key
var API_KEY = env.CLOUD_MESSAGE_API_KEY;
import { Directive } from '@angular/core';
import { ViewController } from 'ionic-angular';
@Directive({
selector: '[hideTabs]'
})
export class HideTabsDirective {
constructor(private viewCtrl: ViewController) {
// hide tabs when view loads