Skip to content

Instantly share code, notes, and snippets.

View nathansobo's full-sized avatar

Nathan Sobo nathansobo

  • GitHub
  • Boulder, CO
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nathansobo on github.
  • I am nathansobo (https://keybase.io/nathansobo) on keybase.
  • I have a public key ASBzu6sIsvuXpfAfeF6SY7Vt4PdfuLHoIgrBlkpZoVdkTwo

To claim this, I am signing this object:

@nathansobo
nathansobo / nsfw-crash-windows.txt
Last active April 17, 2019 18:14
A crash dump from Atom on Windows originating from the `nsfw` module
CRASH 1:
Operating system: Windows NT
10.0.15063
CPU: amd64
family 6 model 94 stepping 3
2 CPUs
GPU: UNKNOWN
@nathansobo
nathansobo / log-linear-goto-intuition.md
Last active June 27, 2019 08:11
Intuition for `merge_op` in Raph Levein's GOTO implementation

When merging an operation O, there may be several operations scattered through the local history that are concurrent to O. We need to rearrange our history so that all of these concurrent operations are moved to the end of the history. Then we can transform O against each of these concurrent operations and append it to the end.

Say we're adding O a history with the following suffix. The operations surrounded by vertical bars are concurrent to O. Otherwise the operations causally precede O.

EO0 |EO1| EO2 EO3 |EO4| |EO5| EO6

We need to rearrange this history so it looks like this.

const fs = require('fs')
global.profileEditor = async function () {
const sampleText = fs.readFileSync('/Users/nathan/src/atom/spec/fixtures/sample.js', 'utf8') + '\n'
// await profileScrollFullScreen()
// await timeoutPromise(500)
// await profileScrollHalfScreen()
// await timeoutPromise(500)
await profileCharacterInsertion()
@nathansobo
nathansobo / options-as-ref.rs
Created March 28, 2016 05:37
Lots of `as_ref`... Am I doing this right?
fn find_lower_bound(&self, target: &Point) -> Option<Rc<Node<'a>>> {
self.root.as_ref().and_then(|root| {
let mut current_node: Rc<Node> = root.clone();
let mut max_lower_bound: Option<Rc<Node>> = None;
let mut left_ancestor_end = Point::zero();
loop {
let current_node_start = left_ancestor_end.traverse(&current_node.new_distance_from_left_ancestor);
if target < &current_node_start {
if current_node.left_child.is_none() {
@nathansobo
nathansobo / gist:d57e7de1fb734ffe878f
Created March 24, 2016 11:05
Process sample of Atom hanging on SSHFS file system interaction via libgit2
Notice the majority of the time in this sample is spent checking for ignored files in `git.node`:
```
Sampling process 2008 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Atom Helper (pid 2008) every 1 millisecond
Process: Atom Helper [2008]
Path: /Users/nathansobo/Downloads/Atom 1.6.app/Contents/Frameworks/Atom Helper.app/Contents/MacOS/Atom Helper
Load Address: 0x10c5d2000
Identifier: com.github.atom.helper

Subject: Martin Acres has major design problems

I live at the corner of 34th and Martin Drive. Last week I was talking to my neighbor, whose 2 year old daughter was wandering down the sidewalk toward my house. Suddenly two cars came screaming down Martin at what had to be in excess of 40 MPH, and I could see the terror in his eyes as he went sprinting toward his daughter.

Unfortunately, this is the norm on Martin Drive. While the city deploys vans to send people tickets in the mail, I don't think it's working. This isn't a problem that can be solved with enforcement. It's a design problem. My own daughter will be born in May, and I'm already starting to worry.

The streets in Martin Acres are designed for higher speeds than are safe for a residential neighborhood. The corners are rounded with a massive radius. The sidewalks are extremely narrow, and the streets are extremely wide with clear sight lines due to a lack of street trees. Every cue tells the drivers, "this is a place for cars; you're safe; dr

Process: Atom Helper [93084]
Path: /Applications/Atom.app/Contents/Frameworks/Atom Helper.app/Contents/MacOS/Atom Helper
Identifier: com.github.atom.helper
Version: 1.5.0-dev-18f2f28 (1.5.0-dev-18f2f28)
Code Type: X86-64 (Native)
Parent Process: Atom [66907]
Responsible: Atom [66907]
User ID: 501
Date/Time: 2016-01-29 14:00:30.935 -0700
VerticalLinePositionIndex
insertBlock(row, height) // return id
updateBlock(id, height)
destroyBlock(id)
splice(startRow, oldExtent, newExtent)
verticalPixelPositionForRow(row)
rowForVerticalPixelPosition(verticalPixelPosition) ->
_ = require 'underscore-plus'
{extend, flatten, toArray, last} = _
TextEditorView = require '../src/text-editor-view'
TextEditorComponent = require '../src/text-editor-component'
nbsp = String.fromCharCode(160)
fdescribe "TextEditorComponent", ->
[contentNode, editor, wrapperView, wrapperNode, component, componentNode, verticalScrollbarNode, horizontalScrollbarNode] = []
[lineHeightInPixels, charWidth, nextAnimationFrame, noAnimationFrame, tileSize, tileHeightInPixels] = []