Skip to content

Instantly share code, notes, and snippets.

View SeptiyanAndika's full-sized avatar
🏠
Working from home

Septiyan Andika SeptiyanAndika

🏠
Working from home
View GitHub Profile
# setup test https://github.com/nucypher/mock-net
# install first pipenv (sudo pip3 install pipenv)
- git clone https://github.com/nucypher/mock-net
- cd mock-net
- pipenv shell
- git clone https://github.com/nucypher/pyUmbral.git
- pip3 install -e pyUmbral
- pipenv install
@SeptiyanAndika
SeptiyanAndika / MultiCampaign.sol
Created May 13, 2018 01:42
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.23+commit.124ca40d.js&optimize=false&gist=
pragma solidity ^0.4.0;
import "./stringUtils.sol";
contract MultiCampaign {
struct Campaign {
uint256 maxContributor;
uint256 minContributor;
bool campaignEnd;
@SeptiyanAndika
SeptiyanAndika / MultiCampaign.sol
Created May 13, 2018 01:32
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.23+commit.124ca40d.js&optimize=false&gist=
pragma solidity ^0.4.0;
import "./stringUtils.sol";
contract MultiCampaign {
struct Campaign {
uint256 maxContributor;
uint256 minContributor;
bool campaignEnd;
@SeptiyanAndika
SeptiyanAndika / Test.sol
Created May 13, 2018 00:04
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.23+commit.124ca40d.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract Test{
event callMeMaybeEvent(address _from);
function testFunction() public {
emit callMeMaybeEvent(msg.sender);
}
}
'use strict';
var jwt = require('jsonwebtoken');
var request = require('request');
var jwkToPem = require('jwk-to-pem');
var PEMS = null;
console.log('Loading function');
/**
* AuthPolicy receives a set of allowed and denied methods and generates a valid
* AWS policy for the API Gateway authorizer. The constructor receives the calling
const jwt = require('jsonwebtoken');
const jwkToPem = require('jwk-to-pem');
const jwt_set = require('./jwt_set.json')
const pems = {}
for(let i = 0; i<jwt_set.keys.length; i++){
// take the jwt_set key and create a jwk object for conversion into PEM
const jwk = {
kty: jwt_set.keys[i].kty,
n: jwt_set.keys[i].n,
@SeptiyanAndika
SeptiyanAndika / ExcelFormulas.js
Created March 22, 2018 17:21 — forked from pies/ExcelFormulas.js
Few Excel formulas - PMT, PPMT, XIRR - expressed in Javascript
/* Based on
* - EGM Mathematical Finance class by Enrique Garcia M. <[email protected]>
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1)
*/
var ExcelFormulas = {
PVIF: function(rate, nper) {
return Math.pow(1 + rate, nper);
},
go-dep-example
==============
0. `brew install dep`
1. `dep init`. This will generate following tree
```
.
├── Gopkg.lock
├── Gopkg.toml
├── README.md
@SeptiyanAndika
SeptiyanAndika / dep.md
Created March 20, 2018 23:47 — forked from subfuzion/dep.md
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

import (
"github.com/valyala/fasthttp"
"fmt"
"encoding/json"
)
type HttpHelper struct {
}