- Endpoints might be great alternative to Mashery/Apigee with cloud integration
- gRPC seems to be Google's standard for service to service communication. Services are gRPC, JSON API generated and proxied to gRPC service with endpoints (you essentially pass it your proto file and your openapi spec and it maps it together).
- gRPC allows you to easily create libraries for all major languages
- Extensible and flexible interface to apis
- gRPC + endpoints samples: https://cloud.google.com/endpoints/docs/samples-videos-articles#nodejs_samples
- Endpoints tutorials: https://cloud.google.com/endpoints/docs/frameworks/java/get-started-frameworks-java
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
# python auth.py /path/to/creds.json | |
# To install | |
# brew install python | |
# gcloud components install app-engine-python | |
# pip install --upgrade google-api-python-client | |
import sys | |
import json | |
import httplib2 | |
import os |
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 sys | |
import json | |
import httplib2 | |
import os | |
from oauth2client.service_account import ServiceAccountCredentials | |
if sys.argv < 2: | |
print "Usage auth [path-to-json]" | |
else: | |
keyPath = sys.argv[1] |
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 getNextFibonacciAfter = (function() { | |
var fibonacciNumbers = [0, 1]; | |
function nextFibonnacciIn(numbers) { | |
return numbers[numbers.length] + numbers[numbers.length - 1]; | |
} | |
return function(number) { | |
var nextFibonacci; |
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
# Shoot.. this is pointless actually. You can do this by `git diff origin/development...HEAD` | |
# Do a git diff between development, only on your changes by finding | |
# the last commit hash in your branch which is in development and diffing on that. | |
origin_development_hashes=$(git log --pretty=format:'%H' origin/development | tail -300) | |
for hash in `git log --pretty=format:'%H' | tail -300`; do; | |
[[ $origin_development_hashes =~ "$hash" ]] && found=$hash && break; | |
done; | |
if [ $found != "" ]; then |
- Rather than writing a lot of imperative code how can we write more straightforward/simpler/consistent code, less prone to bugs.
- Spawned off with needing to solve binding and data store issues when updgrading to Polymer 1.
- Polymer 0.x used the Object observe to update bindings. We referenced a global store using basically an Object.assign function that updated elements referencing those objects.
- Came up with an
inf-store-observer
component to listen for and bind updates
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> | |
<title>Calculator</title> | |
</head> | |
<body> | |
<basic-calculator></basic-calculator> | |
<template id="basicCalcTemplate"> | |
<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
/** | |
* Simple benchmark copy paste for browsers using Benchmark.js | |
* See their documentation: https://benchmarkjs.com/ | |
* Edit the different suite add() sections below to change your tests or add new ones. | |
*/ | |
var Script = function(url) { | |
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; | |
po.src = url; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); |
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
// via http://www.redotheweb.com/2015/09/18/declarative-imperative-js.html | |
function getValue(object, propertyName) { | |
if (!propertyName) throw new Error('Impossible to set null property'); | |
return typeof object === 'undefined' ? undefined : object[propertyName]; | |
} | |
function getNestedValue(object, propertyName) { | |
return propertyName.split('.').reduce(getValue, object); | |
} |
NewerOlder