This file contains 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
<!--- | |
- author: your-github-user-name | |
- formats | |
- websites | |
- ads | |
- stories | |
---> | |
<!-- |
This file contains 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
const fetch = require('node-fetch'); | |
const REGEX_EXTENSION_DIR = /extensions\/(amp-[^\/]+)$/; | |
const GITHUB_AMPHTML_TREE_URL = 'https://api.github.com/repos/ampproject/amphtml/git/trees/master?recursive=1'; | |
const fetchComponentList = async () => { | |
const response = await fetch(GITHUB_AMPHTML_TREE_URL); | |
const data = await response.json(); | |
return data.tree.map((item) => item.path.match(REGEX_EXTENSION_DIR)) | |
.filter((match) => match && !match[1].endsWith('impl')) |
This file contains 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"> | |
<script async src="https://cdn.ampproject.org/v0.js"></script> | |
<script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script> | |
<link rel="canonical" href="https://ampbyexample.com/components/amp-sidebar/"> | |
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> | |
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</ |
This file contains 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 amp lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<script async src="https://cdn.ampproject.org/v0.js"></script> | |
<title>Hello, AMPs</title> | |
<link rel="canonical" href="http://example.ampproject.org/article-metadata.html" /> | |
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> | |
<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script> |
This file contains 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
<!-- | |
#### Introduction | |
AMP HTML files don't support the normal HTML `img` tag. With `amp-img` AMP | |
provides a powerful replacement. | |
--> | |
<!doctype html> | |
<html ⚡> | |
<head> | |
<meta charset="utf-8"> |
This file contains 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
curl -X POST \ | |
-H "Authorization: key= YOUR-API-KEY" \ | |
-H "Content-Type: application/json" \ | |
-d '{ | |
"registration_ids": [ | |
"YOUR-GCM-REGISTRATION-ID" | |
], | |
"data": { | |
"message": "Hello Message" | |
}, |
This file contains 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
TicTacToe ticTacToe = new TicTacToe(); | |
ticTacToe.move(position); | |
if(!ticTacToe.isFinished()){ | |
waitForNextMove(ticTacToe); | |
}else{ | |
handleGameResult(ticTacToe); | |
} |
This file contains 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
class DeadCell | |
def to_s | |
' ' | |
end | |
end | |
class AliveCell |
This file contains 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
describe "Saying Hello"{ | |
fact new Greeter("Sebastian").sayHello => "Hello Sebastian" | |
} | |
@Data class Greeter{ | |
String name | |
def sayHello(){ | |
"Hello " + name | |
} | |
} |
This file contains 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
package matchers | |
describe "Matchers"{ | |
val personOfAgeFour = new Person("A", 4) | |
val personOfAgeFive = new Person("B", 5) | |
context "Hamcrest"{ | |
fact "Example:"{ |
NewerOlder