Skip to content

Instantly share code, notes, and snippets.

View lakamsani's full-sized avatar

Vamsee Lakamsani lakamsani

View GitHub Profile
== need to send this in my API's POST body ===
{
"match": {
"type": "Tournament"
},
"attrs": {
"name": 1
},
"sort": {
"joinEndTime": 1
FROM gw000/keras:1.2.2-py3 # https://hub.docker.com/r/gw000/keras/
MAINTAINER vamsee@onkore.com
# install additional python packages
RUN pip3 --no-cache-dir install \
# jupyter notebook and ipython (Python 3)
ipython \
ipykernel \
jupyter \
Verifying that "vamsee.id" is my Blockstack ID. https://onename.com/vamsee

With reference to OpenZeppelin/openzeppelin-contracts#584 (comment) , here is the working code. Thanks https://github.com/Shrugs

it('Token transfer', async () => {
    const fromAccount = accounts[1]
    const toAccount = accounts[4]
    const transferLimit = 4000000000000000000
    const transferAmount = 3000000000000000000
    let ecoSystemBalance = await tokenInstance.balanceOf(fromAccount)
    assert.isAtLeast(ecoSystemBalance, transferLimit, 'From account balance should be atleast 4')
// run it with: /usr/local/bin/node -r babel-register mongoos-mongodb3.6.js
import mongoose from 'mongoose'
import TestModel from './TestMongooseModel'
(async () => {
/*
https://docs.mongodb.com/manual/reference/connection-string/#urioption.authSource
https://github.com/Automattic/mongoose/issues/6041
@lakamsani
lakamsani / sendRaw.js
Created April 11, 2018 18:05
sendRawTransaction
import EthUtil from 'ethereumjs-util'
import EthWallet from 'ethereumjs-wallet'
import SolidityFunction from "web3/lib/web3/function"
import EthTx from 'ethereumjs-tx'
import contract from 'truffle-contract'
import lodash from 'lodash'
async callContract(wallet, deployedContract, methodName, params=[], options={}) {
let solidityFunction = new SolidityFunction('', lodash.find(deployedContract.abi, { name: methodName }), '')
<!DOCTYPE html>
<html>
<head>
<title>First React App</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src='https://unpkg.com/babel-standalone@6/babel.min.js'></script>
</head>
<body>
<div id='app'></div>
// deployer script
let SampleCrowdsale = artifacts.require('./SampleCrowdsale.sol')
let SampleToken = artifacts.require('./SampleToken.sol')
let moment = require('moment')
const multiplier = 10 ** 18
module.exports = function (deployer) {
const startTime = Math.round(moment().subtract(1, 'd').valueOf() / 1000) // Yesterday
const endTime = Math.round(moment().add(20, 'd').valueOf() / 1000) // Today + 20 days
deployer.deploy(SampleToken).then(function () {
{
"contractName": "PulseToken",
"abi": [
{
"constant": true,
"inputs": [],
"name": "mintingFinished",
"outputs": [
{
"name": "",

Dear Joyent,

On this excellent content page, https://www.joyent.com/node-js/production/design/errors

the following sentences have grammar errors or sentence formation errors

There are a lot of ways this that continuing on can lead to serious bugs that are extremely difficult to track down