Skip to content

Instantly share code, notes, and snippets.

notes of things i learn while watching destroy all software

##das-0001-statistics-over-git-repositories

  • git rev-list HEAD -- takes the ref (in this case HEAD) and crawling backwards. so the most recent commit will appear first
    • to reverse (have most recent be first) git rev-list --reverse HEAD oldest -> newest
  • xargs
    • takes multiline output and joins them with a space
    • e.g.

$ echo '1

#react talk for brooklynjs

##what is react

  • javascript library for building user interfaces
  • (should i talk about mvc here?)
  • uses a virtual dom diff implementation -- essentially, when you React.createClass this class (say, Hero) will return some html -- very DOM-like. then when this component is rendered, React uses its virtual DOM (is it stores virtual DOM) to figure out where it needs to insert this new html in order to make the virtual DOM === real DOM
  • one-way data flow -- essentially, React classes have props -- which are like pieces of data. these props are passed down from one component to the next, the goal being a) it's easier to follow the data flow b) keeps things modular c) fast -> versus two-way data binding -> example

#what is an event loop? this vid

  • JS
    • heap - where mem allocation happens
    • call stack (in chrome it's essentialy v8) - where stack frames are
      • --> look to...
  • web apis - extra things the browser provides
    • dom
    • ajax
  • setTimeout
// 1. describe virtual dom
// (as obj / list; start with list, expand as nec)
// node : obj attributes : list html
const rootNode = [
'div', {
'style': {
'textAlign': 'center',
'color': 'blue',
'margin': '20px'
}
import math
array = [] # 2407905288
three = [2, 4, 1, 3, 5]
five = [1, 20, 6, 4, 5]
with open('./IntegerArray.txt') as f:
for line in f:
array.append(int(line))

Keybase proof

I hereby claim:

  • I am sranso on github.
  • I am sranso (https://keybase.io/sranso) on keybase.
  • I have a public key whose fingerprint is 41BF 5523 FE98 9D2B F7F8 F7DF 7AF1 6419 3ABD A0A8

To claim this, I am signing this object:

1 week before the next

  • check up on aciton items; how are ppl doing, do they need help etc
  • set up meeting day before / morning of TH with christina and EMs to determine OpEx winner

day before/morning of

  • buy another gift card ($99.99), print out
  • send email including...
  • check up again on aciton items; how are ppl doing, do they need help etc
function Node(val, num) {
this.val = val;
this.num = num;
}
var a = new Node('a', 1);
var b = new Node('b', 1);
var c = new Node('c', 1);
var d = new Node('d', 1);
var e = new Node('e', 1);
var graph = {
a: ['b', 'c'],
b: ['d', 'e', 'f'],
c: ['g'],
g: ['h']
};
function traverseDFS(root, target, graph, visited) {
if (!visited) visited = {};
if (root.toString() === target.toString()) return target;
/*
* What this function does:
* Given n non-negative integers representing an elevation map where the width of each bar is 1,
* compute how much water it is able to trap after raining.
*/
function getRainCapacity(array) {
var arrayLength = array.length;
var water = 0;
/*