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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>AppleAntiAliasingThreshold</key> | |
<integer>1</integer> | |
<key>ApplePressAndHoldEnabled</key> | |
<false/> | |
<key>AppleScrollAnimationEnabled</key> | |
<integer>0</integer> |
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
import sys, os, json | |
from datetime import datetime | |
sys.path.append("modules") | |
import requests | |
############################ | |
### STRAVA API PARAMETERS ## | |
############################ | |
# The URL of the API, that we will query to get information on Thomas' activities. |
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
exports.handler = async (event) => { | |
const params = event.queryStringParameters; | |
const environment = params.environment; | |
let redirectionUrl; | |
switch(environment){ | |
case 'development': | |
url = "http://localhost:8080"; | |
break; |
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
exports.handler = async (event) => { | |
const response = { | |
statusCode: 302, | |
headers: { | |
"Location" : "https://example.com" | |
}, | |
body: null | |
}; | |
return 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
assert.equal(await cryptoRun.challengeStatus(), 'ongoing') | |
await forceOracleStatus('accomplished') | |
await cryptoRun.refreshChallengeStatus() | |
await waitForOracleCallback() | |
assert.equal(await cryptoRun.challengeStatus(), 'accomplished') |
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
/* | |
* Helper to remotely update the test Oracle endpoint | |
*/ | |
async function forceOracleStatus(status) { | |
const util = require('util') | |
const exec = util.promisify(require('child_process').exec) | |
const awsCliCommand = 'aws lambda update-function-configuration --profile cryptizens-lambdas-deployer --function-name CryptoRunTest --environment Variables={status=' + status + '}' | |
const { stdout, stderr } = await exec(awsCliCommand) |
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
import os, json | |
STATUS = os.environ['status'] | |
def lambda_handler(event, context): | |
response = { | |
"statusCode": 200, | |
"headers": { "Content-Type": "application/json" }, | |
"body": json.dumps( { "challenge_status": STATUS } ) |
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
pragma solidity ^0.4.21; | |
// Import the Oraclize contract code so we can inherit from it | |
// Note that in our local test environment, we need to import the .sol file | |
// from the environment directly, whereas on the public nets we need to | |
// use the github version instead. | |
/* import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; */ | |
import "./usingOraclize.sol"; | |
contract CryptoRun is usingOraclize { |
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 CryptoRun = artifacts.require('./CryptoRun.sol') | |
contract('CryptoRun', function ([owner, beCode, donor1, donor2, hacker]) { | |
let cryptoRun | |
let cryptoRunAddress | |
beforeEach('setup contract and Oracle for each test', async function () { | |
cryptoRun = await CryptoRun.new(beCode) | |
cryptoRunAddress = await cryptoRun.address | |
await forceOracleStatus('ongoing') |
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
pragma solidity ^0.4.21; | |
contract BountyHunt { | |
// The hashed version of the secret to unlock the bounty | |
bytes32 public hashedSecret; | |
// The constructor function, called when we deploy the contract | |
function BountyHunt(bytes32 _hashedSecret) public { | |
hashedSecret = _hashedSecret; | |
} |
NewerOlder