Skip to content

Instantly share code, notes, and snippets.

View juanfranblanco's full-sized avatar
👋
Always here... (when not sleeping)

Juan Blanco juanfranblanco

👋
Always here... (when not sleeping)
  • United Kingdom
View GitHub Profile
@MelbourneDeveloper
MelbourneDeveloper / Stuff That Software Developers Do.md
Last active April 15, 2024 12:30
Stuff That Software Developers Do

Stuff That Software Developers Do

This is a list of stuff that the average software developer does from week to week

Coding

  • Code design
  • Refactoring
  • Algorithms
  • Profiling
  • Code reviews
  • Building frameworks
@chriseth
chriseth / snarktest.solidity
Last active December 3, 2023 07:03
zkSNARKs test code
// 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
@JcBernack
JcBernack / BigDecimal.cs
Last active June 17, 2024 19:29
BigDecimal
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
@daviwil
daviwil / 003_1_initial_code.fs
Created August 26, 2016 14:03
Source code from Episode 003 of the_dev_aspect
//
// --------- Model ---------
//
type Details =
{ Name: string
Description: string }
type Item =
{ Details: Details }
@naddison36
naddison36 / keybindings.json
Created May 22, 2016 12:05
Adding compile shortcuts to the VS Code Solidity extension
// 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
@nmushegian
nmushegian / test.sol
Created August 23, 2015 11:47
dappsys/test/test.sol
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);
@linagee
linagee / contracts.js
Created August 21, 2015 19:48
Contract finder
//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",