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> | |
<style> | |
body { | |
background-color: white; | |
} | |
</style> | |
</head> | |
<body> |
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
(params) => { | |
let tree = api.run("this.list_commits", {owner: params.owner, repo: params.repo}); | |
var commit_count = tree.length; | |
var random_commit = tree[Math.floor(Math.random() * commit_count)]; | |
return random_commit; | |
} |
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
(params) => { | |
// use our data connection to get a list of all repository commits | |
let commits = api.run("this.list_commits", {owner: params.owner, repo: params.repo}); | |
// select a random commit from the list | |
var commit_count = commits.length; | |
var random_commit = commits[Math.floor(Math.random() * commit_count)]; | |
return random_commit; |
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
SELECT * FROM github.list_commits | |
WHERE owner=@owner | |
AND repo=@repo |
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
<script> | |
const transposit = new Transposit.Transposit( | |
"eilidhsouthren", | |
"git_a_commit", | |
"https://api.transposit.com", | |
); | |
</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
transposit.runOperation('get_a_commit', {owner: user, repo: repo}).then((response) => { | |
if (response.status !== "SUCCESS") { | |
console.log(response); | |
throw response; | |
} |
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
transposit.runOperation('get_a_commit', {owner: user, repo: repo}).then((response) => { | |
if (response.status !== "SUCCESS") { | |
console.log(response); | |
throw response; | |
} |
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
/* | |
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. 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. | |
* A copy of the License is located at | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* or in the "license" file accompanying this file. This file is distributed | |
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | |
* express or implied. See the License for the specific language governing |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Metamagical Themas, Douglas R Hofstadter | |
# Self-Referential Sentences: a follow up | |
# | |
# The noted logician Raphael Robinson submitted a playful puzzle | |
# in the self documenting genre. Readers are asked to complete | |
# the following sentence: | |
# | |
# "In this sentence, the number of occurrences of 0 is _, of 1 |
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
void main() { | |
void runTestCases(Function scoringFunction) { | |
print(scoringFunction(1, 1) == 'Player 1: fifteen, Player 2: fifteen' | |
? 'passes' | |
: 'fail: output = ${scoringFunction(1, 1)}'); | |
print(scoringFunction(3, 0) == 'Player 1: forty, Player 2: love' | |
? 'passes' | |
: 'fail: output = ${scoringFunction(3, 0)}'); | |
print(scoringFunction(4, 4) == 'Deuce' | |
? 'passes' |
OlderNewer