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 admin = require('firebase-admin'); | |
admin.initializeApp({ | |
credential: admin.credential.cert('./movies-387bf-firebase-adminsdk-4hoi8-c52699119b.json'), | |
databaseURL: 'https://movies-387bf.firebaseio.com', | |
}); | |
// Get a database reference to our blog | |
const db = admin.database(); |
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 ReactGA from 'react-ga'; // https://github.com/react-ga/react-ga | |
import { React, Component } from 'react'; | |
class MyApp extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
someData: null, | |
}; |
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
/* eslint-disable no-console */ | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
/* | |
Shopify issues a HTTP POST request. | |
- https://help.shopify.com/api/tutorials/webhooks#receive-webhook |
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
<script> | |
// makes the dropdown sticky on hover and removes it on scrolling | |
jQuery(document).ready(function () { | |
/* | |
On hovering over the products button, when the mouse is moved away, | |
then make the dropdown stick by resetting the attributes to do that | |
per Avada setup. | |
*/ | |
jQuery('.shop-main-menu').hover(null, function() { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Touchscreen Test</title> | |
<style> | |
body { | |
text-align: center; | |
} |
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
Show hidden characters
{ | |
"extends": "airbnb", | |
"plugins": [ | |
"react" | |
], | |
"rules": { | |
"max-len": [2, 122], | |
"comma-dangle": [0], | |
"react/jsx-closing-bracket-location": [1, "tag-aligned"] | |
}, |
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 request = require('request'); | |
const GOOGLE_API_KEY = 'your api key'; // from https://console.developers.google.com/apis/credentials | |
const urlToShorten = 'http://www.thelongurltoshorten.com'; | |
const shortenerUrl = `https://www.googleapis.com/urlshortener/v1/url?key=${GOOGLE_API_KEY}`; | |
const options = { | |
uri: shortenerUrl, | |
json: { | |
longUrl: urlToShorten |
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 scrypt = require('scrypt-async'); | |
const nacl = require('tweetnacl'); | |
nacl.util = require('tweetnacl-util'); | |
// utility functions | |
// ----------------- | |
function printStage(stage) { | |
console.log(stage); | |
console.log('-'.repeat(stage.length)); | |
} |
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
let getBillableHours = function(projectId) { | |
function sumTimes(times) { | |
let billableHours = 0; | |
for(let time of times) { | |
billableHours += parseFloat(time.hours); | |
} | |
return billableHours; |