#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
| define(function (require) { | |
| var module; | |
| // Setup temporary Google Analytics objects. | |
| window.GoogleAnalyticsObject = "ga"; | |
| window.ga = function () { (window.ga.q = window.ga.q || []).push(arguments); }; | |
| window.ga.l = 1 * new Date(); | |
| // Immediately add a pageview event to the queue. |
This is a mix between two sources:
basically the first resource is great but didn't work for me: I had to remove the trailing "/*" in the resource string to make it work. I also noticed that setting the policy on the source bucket was sufficient. In the end these are the exact steps I followed to copy data between two buckets on two accounts
Basically the idea there is:
| "UserData": { | |
| "Fn::Base64": { "Fn::Join":["", [ | |
| "#!/bin/bash -ex\n", | |
| "apt-get update\n", | |
| "apt-get -y install python-setuptools\n", | |
| "mkdir aws-cfn-bootstrap-latest\n", | |
| "curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz | tar xz -C aws-cfn-bootstrap-latest --strip-components 1\n", | |
| "easy_install aws-cfn-bootstrap-latest\n", | |
| "/usr/local/bin/cfn-init --stack ", { "Ref":"AWS::StackName" }, " --resource WebServer", " --region ", { "Ref": "AWS::Region" }, "\n", | |
| "\n", |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| configureDragDrop(registerType) { | |
| var imageThreshold = Math.max(120, window.innerHeight / 4), | |
| sectionThreshold = Math.max(140, window.innerHeight / 4), | |
| currentDY = 0, | |
| frame; | |
| function makeScrollingHandler(threshold) { | |
| function getScrollDY(clientY) { | |
| var speed; | |
| if (clientY < threshold) { |
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
| 'use strict'; | |
| import React from 'react'; | |
| export default class Clearfix extends React.Component { | |
| render() { | |
| const beforeStyle = { | |
| display: 'table' | |
| }; |
Documenting this here, as I often forget (what I have found) is the best way to do this at the moment.
For example, you have a list of two existing security groups given to a stack and wish to create (and use) a third - attaching all to an ALB:
AWSTemplateFormatVersion: '2010-09-09'
Description: Example template| service: my-api-gateway | |
| provider: | |
| name: aws | |
| runtime: nodejs6.10 | |
| region: sa-east-1 | |
| stage: v1 | |
| deploymentBucket: ${env:DEPLOYMENT_BUCKET} | |
| iamRoleStatements: | |
| - Effect: Allow |