Skip to content

Instantly share code, notes, and snippets.

@gaiazov
gaiazov / groovy.rb
Created November 15, 2019 06:02
Groovy 2.4.5 formulae fixed for latest homebrew
class Groovy < Formula
desc "Groovy: a Java-based scripting language"
homepage "http://www.groovy-lang.org"
url "https://dl.bintray.com/groovy/maven/apache-groovy-binary-2.4.5.zip"
sha256 "87e8e9af1f718b84c9bca5a8c42425aadb9e97d8e4ad64e0c91f7c1454cd4caa"
bottle :unneeded
option "with-invokedynamic", "Install the InvokeDynamic version of Groovy (only works with Java 1.7+)"
@gaiazov
gaiazov / Auth.sol
Created April 11, 2018 16:20
AppianWorld 2018 - Ethereum Car Service smart contracts
pragma solidity ^0.4.2;
import "Authority.sol";
contract Auth {
enum AuthMode {
Owner,
Authority
}
'use strict';
const _ = require('underscore');
const async = require('async');
module.exports = {
/**
*
* @param {{eth: {getTransactionReceipt: function, getBlockNumber: function}}} web3
* @param transactionHash
const EthereumTx = require('ethereumjs-tx');
const _ = require('lodash');
class Wallet {
constructor(web3, address, privateKey) {
this.web3 = web3;
this.address = address;
this.privateKey = Buffer.from(privateKey, 'hex');
}
OPERATORS = {'+': (1, lambda x, y: x + y), '-': (1, lambda x, y: x - y),
'*': (2, lambda x, y: x * y), '/': (2, lambda x, y: x / y)}
def eval_(formula):
def parse(formula_string):
number = ''
for s in formula_string:
if s in '1234567890.':
number += s