A Pen by Daniel Stancu on CodePen.
This file contains hidden or 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 { Directive } from '@angular/core'; | |
import { ViewController } from 'ionic-angular'; | |
@Directive({ | |
selector: '[hideTabs]' | |
}) | |
export class HideTabsDirective { | |
constructor(private viewCtrl: ViewController) { | |
// hide tabs when view loads |
This file contains hidden or 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 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; |
This file contains hidden or 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(functions.config().firebase); | |
/** | |
* Triggers when new subject added in the list and sends a notification. | |
*/ | |
exports.sendNotification = functions.database.ref('/subjects/{subjectKey}').onWrite((event) => { |
This file contains hidden or 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
// 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 |
This file contains hidden or 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
<!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> |
This file contains hidden or 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 threading | |
def do_every (interval, worker_func, iterations = 0): | |
if iterations != 1: | |
threading.Timer ( | |
interval, | |
do_every, [interval, worker_func, 0 if iterations == 0 else iterations-1] | |
).start () | |
worker_func () |
This file contains hidden or 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 goodbye(e) { | |
if(!e) e = window.event; | |
//e.cancelBubble is supported by IE - this will kill the bubbling process. | |
e.cancelBubble = true; | |
e.returnValue = 'You sure you want to leave?'; //This is displayed on the dialog | |
//e.stopPropagation works in Firefox. | |
if (e.stopPropagation) { | |
e.stopPropagation(); | |
e.preventDefault(); |
This file contains hidden or 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
<!DOCTYPE html> | |
<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]--> | |
<html class="no-js" lang="en" > | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Foundation 5</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.1/css/normalize.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.1/css/foundation.min.css"> |
NewerOlder