Skip to content

Instantly share code, notes, and snippets.

View yoshi1984's full-sized avatar
🏠
Working from home

Yoshiyuki Yamada yoshi1984

🏠
Working from home
View GitHub Profile

Debugging ES6 in VS Code

My current editor of choice for all things related to Javascript and Node is VS Code, which I highly recommend. The other day I needed to hunt down a bug in one of my tests written in ES6, which at time of writing is not fully supported in Node. Shortly after, I found myself down the rabbit hole of debugging in VS Code and realized this isn't as straightforward as I thought initially. This short post summarizes the steps I took to make debugging ES6 in VS Code frictionless.

What doesn't work

My first approach was a launch configuration in launch.json mimicking tape -r babel-register ./path/to/testfile.js with babel configured to create inline sourcemaps in my package.json. The debugging started but breakpoints and stepping through the code in VS Code were a complete mess. Apparently, ad-hoc transpilation via babel-require-hook and inline sourcemaps do not work in VS Code. The same result for attaching (instead of launch) to `babel-node

@yoshi1984
yoshi1984 / 1README.md
Last active March 1, 2018 22:45 — forked from JoeKarlsson/1README.md
graphql + dataloader + express-graphql Memo

How to test if Dataloader is working correctly, we are going to turn on server logging in order to see how many queries are being made to our db. If Dataloader is setup correctly, we should only see one hit on our db perrequest, even if duplicate data is being requested. Here's how to enable logging on postgresql. Note - This is the Mac way to enable logging.

  • subl /usr/local/var/postgres/postgresql.conf

  • around line 434 log_statement = 'all' uncomment and set to all log_statement = 'all'

  • then brew service restart postgresql

@yoshi1984
yoshi1984 / .babelrc
Created February 22, 2018 21:27 — forked from andrewmunro/.babelrc
Sequelize cli with ES6
{
"presets": ["es2015"],
"plugins": [
"add-module-exports"
],
}
@yoshi1984
yoshi1984 / hitch.rb
Last active February 10, 2017 06:28 — forked from wallrat/hitch.rb
Homebrew brew formula for Varnish'es Hitch TLS Proxy Server
class Hitch < Formula
desc "A scalable TLS proxy by Varnish Software"
homepage "https://github.com/varnish/hitch"
url "https://github.com/varnish/hitch/archive/hitch-1.3.1.tar.gz"
sha256 "2a1c007b752e487a2a85204dcb620ba28fec4d51ebf3fa8528bfb05c94f21efd"
head "https://github.com/varnish/hitch.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "pkg-config" => :build
@yoshi1984
yoshi1984 / 0_reuse_code.js
Created January 5, 2017 12:36
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@yoshi1984
yoshi1984 / install-mysql5.7-circleci.sh
Last active February 29, 2016 05:56 — forked from kimh/install-mysql5.7-circleci.sh
Install MySQL 5.7 non-interactively in CircleCI
#!/bin/bash
set -x
set -e
curl -LO https://dev.mysql.com/get/mysql-apt-config_0.6.0-1_all.deb
echo mysql-apt-config mysql-apt-config/select-product select Apply | sudo debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7-dmr | sudo debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-connector-python select none | sudo debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-workbench select none | sudo debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-utilities select none | sudo debconf-set-selections
@yoshi1984
yoshi1984 / nginx.conf
Last active August 29, 2015 14:13 — forked from mimosz/nginx.conf
# sudo ln -s ~/nginx.conf unicorn.conf
upstream app_server {
server unix:/tmp/unicorn_padrino.sock fail_timeout=0;
}
server {
listen 80;
charset utf-8;
server_name db.innshine.com;
@yoshi1984
yoshi1984 / file0.txt
Created August 27, 2014 15:35
rails4でのcookieの設定・取得 ref: http://qiita.com/deepriver/items/0ba8da53b59b8e33458f
cookie["Cookie名指定"] = "値"
cookies[:hoge3] = "hoge3"
# Twilio HTTP HAProxy Configuration
# Version: 0.1
global
daemon
log 127.0.0.1 local0 info
maxconn 60000
spread-checks 3
class Account < ActiveRecord::Base
def self.search(name = nil)
# search logic
end
end