Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.from(Array(3)).forEach((x, i) => { | |
| something(); | |
| }); | |
| Array.from({ length: 3 }, (x, i) => { | |
| something(); | |
| }); | |
| Array(5).fill().map(()=>{ | |
| // Do this 5 times: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const bypass = [ | |
| // function names to avoid logging | |
| ]; | |
| const collapsed = [ | |
| // function names to groupCollapsed | |
| ]; | |
| module.exports = function(babel) { | |
| const { types: t } = babel; | |
| const wrapFunctionBody = babel.template(`{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Comments | |
| ======== | |
| *---* [Jane Smith] Hey [Rob], what do you think about | |
| | | switching the roll-out plan over to a faster schedule? | |
| *---* | |
| {{{ I guess my concern is that we won't learn fast | |
| enough, and that will put the project... [See More] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Monkey patch Array.prototype | |
| Object.assign(Array.prototype, { | |
| unique() { | |
| return this.filter((value, index, array) => { | |
| return array.indexOf(value) === index; | |
| }); | |
| } | |
| }); |
When a startup closes a new financing round (called a Series A, B, C, and so on), a new share class with preferred rights is usually created. These protect new investors in case the company gets sold at a lower valuation than the current financing round (while founders and employees might still get a pretty nice return). They are called liquidation preferences. When the company is sold (called an “exit”), the money of the exit has to be divided among all shareholders according to these liquidation preferences.
The basic rules are:
The investor gets paid back 1× their originally invested amount, nothing else. The rest is divided among all the other shareholders according to their ownership in the company (this is called “pro-rata”).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://github.com/mehiel/router/blob/58c7aa4d0be87b6c4aad9643f168058f42eafcd7/src/lib/utils.js#L261 | |
| // makeCancelable as in https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html | |
| const makeCancelable = promise => { | |
| let hasCanceled_ = false; | |
| const wrappedPromise = new Promise((resolve, reject) => { | |
| promise.then( | |
| val => (hasCanceled_ ? reject({ isCanceled: true }) : resolve(val)), | |
| error => (hasCanceled_ ? reject({ isCanceled: true }) : reject(error)) | |
| ); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const curry = fn => (...args1) => { | |
| if (args1.length === fn.length) { | |
| return fn(...args1); | |
| } | |
| return (...args2) => { | |
| const args = [...args1, ...args2]; | |
| if (args.length >= fn.length) { | |
| return fn(...args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import ReactDOM from "react-dom"; | |
| import configureStore from "./store/configureStore"; | |
| const store = configureStore(); | |
| const rootEl = document.getElementById("root"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo { | |
| constructor(x,y,z) { | |
| Object.assign(this,{ x, y, z }); | |
| } | |
| hello() { | |
| console.log(this.x + this.y + this.z); | |
| } | |
| } |
NewerOlder