I hereby claim:
- I am phamann on github.
- I am patrickhamann (https://keybase.io/patrickhamann) on keybase.
- I have a public key ASAxo9y-ebYesYfYgC7s5pgxHDpH2OfeACCuJ3uCWYQRswo
To claim this, I am signing this object:
| import { Request, Response, Fastly } from "@fastly/as-compute"; | |
| const HTTPBIN_BACKEND = "httpbin"; | |
| function badRequest(): Response { | |
| return new Response(String.UTF8.encode("Bad request"), { | |
| status: 400 | |
| }); | |
| } |
| #[macro_use] | |
| extern crate lazy_static; | |
| use fastly::http::{Method, StatusCode}; | |
| use fastly::{ | |
| Body, Error, PendingRequest, Request, RequestBuilderExt, RequestExt, Response, ResponseExt, | |
| }; | |
| use regex::Regex; | |
| use std::convert::From; |
| { | |
| "timestamp": 1597148043, | |
| "client": { | |
| "client_ip": "", | |
| "client_user_agent": "Chrome 84.0.4147", | |
| "client_asn": 5089, | |
| "client_asname": "virgin media limited", | |
| "client_city": "haringey", | |
| "client_country_code": "GB", | |
| "client_continent_code": "EU", |
I hereby claim:
To claim this, I am signing this object:
| require('dotenv').config(); | |
| const fetch = require('node-fetch'); | |
| const API = 'https://api.fastly.com'; | |
| const TOKEN = process.env.FASTLY_API_TOKEN; | |
| const OPTIONS = { | |
| headers: { | |
| 'Fastly-Key': TOKEN, | |
| 'Accept': 'application/json' | |
| } |
| id | first_name | last_name | gender | ip_address | ||
|---|---|---|---|---|---|---|
| 1 | Jerry | Simpson | [email protected] | Male | 65.216.136.96 |
| console.log("Worker startup"); | |
| this.oninstall = function(event) { | |
| console.log('Worker install'); | |
| event.waitUntil( | |
| caches.create('static').then(function(cache) { | |
| return cache.add( | |
| //Templates |
| requirejs: { | |
| options: { | |
| baseUrl: "common/app/assets/javascripts", | |
| paths: { | |
| "bean": "components/bean/bean", | |
| "bonzo": "components/bonzo/src/bonzo", | |
| "domReady": "components/domready/ready", | |
| "EventEmitter": "components/eventEmitter/EventEmitter", | |
| "qwery": "components/qwery/mobile/qwery-mobile", | |
| "reqwest": "components/reqwest/src/reqwest", |
Below is a collection of my favourite responses I gathered from Guardian engineers when asked the question: What have you learnt starting from scratch and building a mobile-first next generation web platform for the Guardian?
| //You are using underscores extend so you need include it :) | |
| define(['underscore'], function(_) { | |
| //This could be some kind of utilities modules | |
| //Define the extend method | |
| var extend = function() { | |
| _.extend(Backbone.Router.prototype, Backbone.Events, { | |
| before: function() {}, | |
| after: function() {}, |