This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------------------------------------------------------------------- | |
# Create SoundCloud-style waveforms from mp3 files | |
# Author: David Cornu | |
# Credit for the idea goes to http://cl.ly/292t2B09022I3S3X3N2O | |
# | |
# Requirements: | |
# mpg123 - [ % brew install mpg123 ] | |
# imagemagick - [ % brew install imagemagick ] | |
# rmagick - [ % brew install rmagick ] | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'cgi' | |
lint = `/usr/local/bin/jslint4java #{ENV['TM_FILEPATH']}` | |
lrxp = Regexp.new(/jslint:.+.js:(\d+):(\d+):(.+)/i) | |
output = String.new | |
lint.split("\n").each do |error| | |
match = lrxp.match(error) | |
line = `cat #{ENV['TM_FILEPATH']} | head -#{match[1]} | tail -1` |
NewerOlder