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.0; | |
//Interface | |
interface Regulator{ | |
//Methods to implement | |
function checkValue(uint amount) returns(bool); | |
function loan() returns(bool); | |
} | |
//Extension of Rregulator interface | |
contract Bank is Regulator{ |
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
contract TestThrows{ | |
//Assert takes boolean. | |
//Used in concept of checking data values | |
function testAssert(){ | |
assert(1==2); | |
} | |
//Require takes boolean | |
//More parameter requirement | |
function testRequire(){ |
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.0; | |
//keyword library | |
library IntExtended{ | |
function increment(uint _base) returns(uint){ | |
return _base+1; | |
} | |
function decrement(uint _base) returns(uint){ | |
return _base-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
<?php if(function_exists('fetch_feed')) { | |
include_once(ABSPATH.WPINC.'/feed.php'); | |
$feed = fetch_feed('https://www.snippet.uk/groups/not-forgotten/blog/feed/all'); | |
$limit = $feed->get_item_quantity(7); // specify number of items | |
$items = $feed->get_items(0, $limit); // create an array of items | |
} | |
if ($limit == 0) echo '<div>The feed is either empty or unavailable.</div>'; |
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
#!/bin/bash | |
d=`date +%Y-%m-%d` | |
filename="$d.md" | |
echo $1 >> $filename | |
git add . | |
git commit -m "$filename" | |
git push |
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.5.0; | |
import "@openzeppelin/contracts/math/SafeMath.sol"; | |
contract Waterfall { | |
using SafeMath for uint; | |
struct User { | |
address payable addr; | |
uint amount; |
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.5.0; | |
contract Fabcar { | |
struct Car { | |
string make; | |
string model; | |
string color; | |
string owner; | |
} |
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
/* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
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 IBM Corp. All Rights Reserved. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
*/ | |
'use strict'; | |
const shim = require('fabric-shim'); | |
const util = require('util'); |
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.5.0; | |
import "@openzeppelin/contracts/math/SafeMath.sol"; | |
contract Handover { | |
using SafeMath for uint; | |
address payable public owner; | |
address payable public user; |
OlderNewer