| <!doctype html> | |
| <style> | |
| html, body { | |
| margin: 0; | |
| background-color: #CCC; | |
| box-sizing: border-box; | |
| } | |
| .item { | |
| margin: 20px; | |
| padding: 20px; |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
| (function() { | |
| // TODO: rootMargin are completely ignored for now | |
| // Constructor | |
| window.IntersectionObserver = function(callback, options) { | |
| options = options || {}; | |
| if(!(callback instanceof Function)) { | |
| throw('callback needs to be a function'); | |
| } |
No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.
Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.
- A Russian translation of this article can be found here, contributed by Timur Demin.
- A Turkish translation can be found here, contributed by agyild.
- There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
| /*! | |
| * Copyright 2015 Google Inc. All rights reserved. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| var Middleware = function() {}; | |
| Middleware.prototype.use = function(fn) { | |
| var self = this; | |
| this.go = (function(stack) { | |
| return function(next) { | |
| stack.call(self, function() { | |
| fn.call(self, next.bind(self)); | |
| }); |
| /** | |
| * Simple debounce function; usage: | |
| * | |
| * Create a function that only can be called once every 500 ms | |
| * | |
| * var df = debounce(function() { | |
| * ... func body ... | |
| * }, 500) | |
| * | |
| * Bind the function to an event |
While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.
Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.
lib/is intended for code that can run as-issrc/is intended for code that needs to be manipulated before it can be used
| var crypto = require('crypto'); | |
| // Added for safer string equality checking | |
| var bufferEq = require('buffer-equal-constant-time'); | |
| var url = require('url'); | |
| var SHARED_SECRET = "sup3rs3cr3t!!"; | |
| function verifySignature(string_to_sign, signature, shared_secret) { | |
| var hmac = crypto.createHmac('sha512', shared_secret); | |
| hmac.write(string_to_sign); | |
| hmac.end() |
