Skip to content

Instantly share code, notes, and snippets.

@eporroa
eporroa / metrics.sh
Created February 12, 2018 22:15 — forked from bspaulding/metrics.sh
codebase metrics
# use noglob on zsh
# change file extensions where appropriate
# collect source file paths for analysis
find . -name "*.js" | grep -v "bower_components" | grep -v "node_modules" > source_files.txt
# number of files in project
wc -l source_files.txt
# number of lines by file
@eporroa
eporroa / docker_usb_guest_osx.md
Created January 27, 2017 20:30 — forked from stonehippo/docker_usb_guest_osx.md
Getting a USB device to show up in a Docker container on OS X

Getting a USB device to show up in a Docker container on OS X

Some background

I was trying to get the Arduino IDE to work inside a Docker container on OS X. I was able to get the IDE working (see Getting X11 GUI applications to work on OS X with Docker), but I could not figure out how to make the USB port for the Arduino visible.

The solution

I first tried to directly map hardware serial port into the Docker container, doing something like this:

@eporroa
eporroa / angular-2.md
Created March 28, 2016 22:21 — forked from marknorgren/angular-2.md
Building Web Apps with Angular 2
gruntFunction = (grunt)->
if grunt.option('dev')
env = 'development'
else if grunt.option('deploy')
env = 'deployment'
else if grunt.option('prod')
env = 'production'
else
env = grunt.option('env') || 'development'
from xml.dom import minidom
import json
config = {
'svg_file' : 'map.svg',
'js_file' : 'map.js',
'js_var' : 'svgMap'
}
svg = minidom.parse(config['svg_file'])