This is a list of stuff that the average software developer does from week to week
- Code design
- Refactoring
- Algorithms
- Profiling
- Code reviews
- Building frameworks
// This file is MIT Licensed. | |
// | |
// Copyright 2017 Christian Reitwiessner | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O |
using System; | |
using System.Numerics; | |
namespace Common | |
{ | |
/// <summary> | |
/// Arbitrary precision decimal. | |
/// All operations are exact, except for division. Division never determines more digits than the given precision. | |
/// Source: https://gist.github.com/JcBernack/0b4eef59ca97ee931a2f45542b9ff06d | |
/// Based on https://stackoverflow.com/a/4524254 |
// | |
// --------- Model --------- | |
// | |
type Details = | |
{ Name: string | |
Description: string } | |
type Item = | |
{ Details: Details } |
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ "key": "ctrl+c", "command": "solidity.compile", | |
"when": "editorTextFocus" }, | |
{ "key": "shift+ctrl+c", "command": "solidity.compile.active", | |
"when": "editorTextFocus" } | |
] |
//Creating a Mongo collection to keep track of events | |
EthEvents = new Mongo.Collection('ethEvents'); | |
EthEvents.attachSchema(new SimpleSchema({ | |
contractAddress: { | |
type: String, | |
index: true | |
}, | |
eventName: { | |
type: String, | |
index: true |
import 'dappsys/test/debug.sol'; | |
contract Test is Debug { | |
bytes32 testname; | |
address me; | |
// easy way to detect if its a test from the abi | |
bool public IS_TEST; | |
bool public failed; | |
function Test() { | |
me = address(this); |
//Look through the last 1000 blocks for contract addresses | |
var contractAddresses = []; | |
var blockNumber = eth.getBlock('latest').number; | |
console.log("Current block number: " + blockNumber); | |
for (var x = blockNumber; x > blockNumber - 1000; x--) { | |
var transactions = eth.getBlock(x).transactions; | |
var transactionsCount = transactions.length; | |
if (transactionsCount != 0) { | |
for (var y = 0; y < transactionsCount; y++) { | |
var transactionReceipt = eth.getTransactionReceipt(transactions[y]); |
import 'dapple/test/test.sol'; | |
import 'mydapp/math.sol'; | |
contract MathTest is Test { | |
Math m; | |
function setUp() { | |
m = new Math(); | |
} | |
function testAdd() { | |
// tests start with `test`. Each is called on a new |
{ | |
"nonce": "0x0000000000000042", | |
"difficulty": "0x40000", | |
"alloc": { | |
"bbbbbaaaaa82db86a35502193b4c6ee9a76ebe8f": { | |
"balance": "10015200000000000000000" | |
} | |
}, | |
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", | |
"coinbase": "0x0000000000000000000000000000000000000000", |