Skip to content

Instantly share code, notes, and snippets.

View thomasvds's full-sized avatar
🚀
SHIP OR DIE

Thomas Vanderstraeten thomasvds

🚀
SHIP OR DIE
View GitHub Profile
<?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>
exports.handler = async (event) => {
const params = event.queryStringParameters;
const environment = params.environment;
let redirectionUrl;
switch(environment){
case 'development':
url = "http://localhost:8080";
break;
exports.handler = async (event) => {
const response = {
statusCode: 302,
headers: {
"Location" : "https://example.com"
},
body: null
};
return response;
}
assert.equal(await cryptoRun.challengeStatus(), 'ongoing')
await forceOracleStatus('accomplished')
await cryptoRun.refreshChallengeStatus()
await waitForOracleCallback()
assert.equal(await cryptoRun.challengeStatus(), 'accomplished')
/*
* 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)
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 } )
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')
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;
}
pragma solidity 0.4.21^;
contract FirstGenEthernityPod {
address public launcher;
int public podId;
bytes32 public firstName;
bytes32 public lastName;
bytes32 public pictureIPFSHash;
pragma solidity ^0.4.21;
contract InsuranceLedger {
// Event to broadcast to the network when a new motorbike has been added
event OnRecordMotorbike(bytes32 _hashedChassisNumber);
// The address of the contract owner (Seraphin), set when the contract is deployed
address public seraphinAddress = msg.sender;
// The mapping with all insured motorbikes - we stick to an extremely simple
// model representation with only the hashed chassis number. A given hashed