Go to your s3 bucket and go to Permissions and then CORS configuration.
You can edit and paste the following snippet after replacing __PRODUCTION_DOMAIN__
and __LOCAL_DOMAIN__
with the real domains.
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
<a target="_blank" rel="noopener noreferrer" href="...">user safe link</a> | |
<script> | |
// New window that leads user generated links shouldn't have access to previous window object. | |
var nw = window.open(); | |
nw.opener = null; | |
</script> |
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
// Voila the all new JS fetch | |
fetch('https://bloody-data-json-url', { | |
method: 'GET', | |
// Ask API to respond with json | |
headers: new Headers({ | |
'Content-Type': 'application/json' | |
}), | |
mode: 'cors', | |
cache: 'default' | |
}) |
"The secret to happiness is freedom. And the secret to freedom is courage." -- Thucydides
"The only true law is that which leads to freedom. There is no other." -- *Richard Bach, Jonathan Livingston Seagull
"If people aren't laughing at your dreams, your dreams aren't big enough." -- Grayson Marshall
"Fear is temporary. Regret is permanent" -- Dan Skinner
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
/** | |
* | |
* Generate screenshot and pdf from webpage | |
* | |
* Read more here: | |
* https://medium.com/@dschnr/using-headless-chrome-as-an-automated-screenshot-tool-4b07dffba79a | |
* https://github.com/GoogleChrome/puppeteer | |
* | |
*/ |
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
/** | |
* Carousel missing left border | |
* Owl carousel removes the container element's left border to avoid having double borders on the left. | |
*/ | |
/* Force parent element to show left border */ | |
.owl-carousel { | |
border-left: 1px solid #e3e3e3 !important; | |
} |
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 React from 'react'; | |
import { isObject } from 'lodash'; | |
export class Foo extends React.Component { | |
recursiveCloneChildren(children) { | |
return React.Children.map(children, child => { | |
if(!isObject(child)) return child; | |
var childProps = {someNew: "propToAdd"}; | |
childProps.children = this.recursiveCloneChildren(child.props.children); | |
return React.cloneElement(child, childProps); |
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> | |
<meta charset="utf-8"> | |
<title>Building a router</title> | |
<script> | |
// Put John's template engine code here... | |
(function () { | |
// A hash to store our routes: |