Skip to content

Instantly share code, notes, and snippets.

View Prtfw's full-sized avatar

Madeleine Shang Prtfw

  • Cambridge, MA | Toronto, ONT
View GitHub Profile
@Prtfw
Prtfw / lec8.ipynb
Last active November 16, 2018 15:48
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Prtfw
Prtfw / mercantis.sol
Last active October 4, 2017 17:48
walk through of the beta 0.1 mercantis smartContract
pragma solidity ^0.4.4; //specify solidity version
/*******************************************************************************************
Mapper Contract - holds mapping & structs for market participants
*******************************************************************************************/
contract mapper { //init a contract
/**************************************
0xaD65d4219E03Cf13F9A54E45B26D2Ac6770f69d9
https://gist.github.com/Prtfw/66d9e94608d222cd8dcf67ac714c11f1
0xaD65d4219E03Cf13F9A54E45B26D2Ac6770f69d9
import React from "react";
import Header from "./Header";
import Order from "./Order";
import Inventory from "./Inventory";
import Fish from "./Fish";
import samples from "../sample-fishes";
import base from "../base";
class App extends React.Component {
constructor() {
@Prtfw
Prtfw / statefulCompoQs.js
Created June 29, 2017 19:19
some questions re: stateful compo and how to approach building one Raw Raw
class Clock extends React.Component {
constructor(props) { // where do we hook up props to ? where does this prop data come from?
super(props); // what is the purpose of this? why do we need to call super?
this.state = { date: new Date() }; // always intialize a state? is the state to be updated by passing in props?
}
componentDidMount() {
this.timerID = setInterval(() => this.tick(), 1000); // is this.timerID a prop or a state? It calls a function that upstates the date variable
TweenMax.fromTo(
@Prtfw
Prtfw / statefulCompoQs.js
Created June 29, 2017 17:37
some questions re: stateful compo and how to approach building one
const API_KEY = '5cc1f25759881907aed6171543839b19';
function getWeather() {
return fetch(`http://api.openweathermap.org/data/2.5/weather?id=6167865&appid=${API_KEY}&units=metric`)
.then(res => res.json())
.then(reshapeData);
}
function reshapeData() {
@Prtfw
Prtfw / callBackTimeStampLN78.js
Created June 27, 2017 20:57
not sure if callback time stamp generated on line 78 is to be trusted.
var AES = require("crypto-js/aes");
const SHA256 = require('crypto-js/sha256')
const Chance = require('chance')
// const testsetL = require('./testData')
// const testsetS = require('./testDatas')
const fs = require('fs');
const l = 10000;