Recent submissions

Comment · 5 years ago
Someone non technical once told me they "programmed as well" and proceed to talk about planning and scheduling things.
Comment · 8 years ago
Comment · 9 years ago
Simple continuation explanation for web developers.

  1. Write some JS code in chrome and verify expected behaviour.
  2. Add a debugger statement.
  3. When the debugger pops up, go down a few frames and add debug point.
  4. Right click the frame and select restart.
  5. In the new break point, write some code in the console to modify the state.
  6. When you step through the code, it now does something else.
Now imagine if the language allow you to do this programmatically in the code by passing the frame around as an argument similar to functions.

I leave the rest to imagination.

Comment · 10 years ago
Comment · 10 years ago
Comment · 10 years ago
Comment · 10 years ago
Sometimes programmers need to look at unusual files: binary files, very big files, odd data files. Epsilon was designed without the limits of other editors, so it can handle these kinds of jobs, as well as ordinary files. For example, with Epsilon, lines can be as long as you like.

This text editor gets it. Such a contrast to some of the editors we have today where anything over a few megabytes is an edge case not worth fixing.

Comment · 10 years ago
Comment · 10 years ago
I'm not sure when promises came to the javascript, but it seems weird that people would settle with callback hell for so long without even attempting to refactoring it.

I mean if I didn't have the option of using promises, I would have probably written something like this.

function handler(callback){

  var state={};

  function logic(step,err,data){  
    if(!step){
      connectToDb("somedatabase",logic.bind(state,1))
    }
    
    if(step==1){
      if(err) callback("error1")
      state.dbInstance=data
      state.dbInstance.query("someQuery",logic.bind(state,2))
    }
    
    if(step==2){
      if(err) callback("error2")
      csvExporter(data,logic.bind(state,3))
    }

    if(step==3){
      if(err) callback("error3")
      callback(data)
    }
  }
  logic()
}
Comment · 10 years ago
This is great. One of my biggest pain points when switching to OS X was finding a good replacement for autohotkey.
Comment · 10 years ago
This is pretty common with a lot of companies switching to byod (bring your own devices to work)

The idea is the company saves money by loading a secure workspace to your personal device instead of paying for a corporate device.

Companies setup a mdm server such as blackberry, good, airwatch, etc that basically send a remote wipe command. You would then download an app to activate it.

It depends on the company but check if there is an opt out clause or demand the company to provide you a corporate phone as you don't have a personal device.

It's ok in most cases since the company is paying for your phone bill as compensation so you can just get a second personal device.

I'm not sure about the legal issues, especially if you can't opt out of it.

Comment · 10 years ago
That data structure is basically a CSV file. If I were you, I would convert the JSON to a CSV file, load it into excel and use a pivot table dive into your data and convert it back if needed.

A pivot table will do exactly what you want and more. If you hate excel, You could load it into a database and do a groupby query. I suspect most JSON in that data structure were auto generated from CSV files or database anyways.

Another option is to just convert that JSON to another JSON keyed by name with Lodash then inspect it.

var anotherJSON=_.keyBy(oldJSON, 'name');

Comment · 10 years ago
Chrome console allows you to inspect an object and expand on the properties visually.

For the most common cases, I just copy and paste the string into the chrome console if I need to inspect some random JSON file really quick.

If it is too big to copy and paste, pipe it into a html file as a global variable and view the object in the console.

You can also just open a node repl and load the JSON into memory. node lets you auto complete property names by pressing tab, this is great for inspecting some unknown object.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton