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; | |
//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
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; | |
import "@openzeppelin/contracts/math/SafeMath.sol"; | |
contract Handover { | |
using SafeMath for uint; | |
address payable public owner; | |
address payable public user; |
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
module.exports = { | |
networks: { | |
development: { | |
host: "127.0.0.1", | |
port: 7545, | |
network_id: "5777", | |
} | |
} | |
} |
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 HelloWorld { | |
string private greeting; | |
constructor() public { | |
greeting = "Hello World"; | |
} | |
function getGreeting() public view returns(string memory){ |
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 HelloWorld = artifacts.require("HelloWorld"); | |
module.exports = function(deployer) { | |
deployer.deploy(HelloWorld); | |
}; |
OlderNewer