View blog_response.md
View 1.explanation.js
function header(name) {
console.log("\n\033[35m----- " + name + " -----\033[0m")
}
function p(...inspections) {
inspections.forEach(inspection => console.dir(inspection, {colors: true}))
}
header("Getting 'false'")
View contributing_to_open_source.md

Submitting a pull request

For the LA Fullstack meetup.

Fork the repository

View event_queue.md

I thought of a fourth linked list in JavaScript: the event queue, which enables asynchronousity. When I realized it must exist, a lot of things finally made sense.

The event queue is a queue of code to be run, it can also contain values to inject (eg the response from an HTTP request). Then, whenever JS finishes executing a piece of code, it dequeues the next bit of work and runs that code. If it runs out of work, it waits for something to enter the queue.

When people in JS talk about "blocking", they mean that you are doing a lot of work in one piece of code. Since it can only execute one at a time (single threaded), this means that the work in the queue isn't getting processed.

View tracepoint_example.rb
trace = TracePoint.new do |tp|
p tp
end
trace.enable
A = Class.new
B = Class.new A
C = Class.new B
View traverse.rb
require 'objspace'
A = Class.new
B = Class.new A
C = Class.new B
network = {}
queue = [C]
9.times do
obj = queue.shift
View heap_dump.rb
require 'objspace'
# a class and instance
class A
end
a = A.new
# dump the heap
outfile = 'dump.json'
View deps.csv
from to strength
SeeingIsBelieving SeeingIsBelieving::SeeingIsBelieving 35
SeeingIsBelieving SeeingIsBelieving::Options 1
SeeingIsBelieving SeeingIsBelieving::EvaluateByMovingFiles 1
SeeingIsBelieving SeeingIsBelieving::EventStream::Handlers::Debug 1
SeeingIsBelieving SeeingIsBelieving::Binary 2
SeeingIsBelieving SeeingIsBelieving::VERSION 1
SeeingIsBelieving SeeingIsBelieving::SeeingIsBelieving::VERSION 1
SeeingIsBelieving SeeingIsBelieving::SeeingIsBelievingError 2
SeeingIsBelieving SeeingIsBelieving::HashStruct 1
View simple_interactive_interpreter.js
function i(obj) {
return JSON.stringify(obj);
}
function Interpreter() {
this.functions = {};
this.variables = {};
}
Interpreter.prototype = {
input: function(expr) {
View countdown.js
// Figure out how it works... if you can ;)
// https://twitter.com/josh_cheek/status/772843021582893056
((y) => (f) => (x) => (f)((y)(y)(f))(x))
((y) => (f) => (x) => (f)((y)(y)(f))(x))
((y) => (f) => (x) => (0) <- (f) || (x)((f) -->> (1)) || (y)(f-1)(x))
((10) | (0) || (2) || (5) <- (f) || (x)((f) -->> (1)) || (y)(f+1)(x))
(console.dir)