Saturday, April 28, 2012

from my gists (ming@katdc.com)

#!/usr/bin/env node const fs = require('fs'); const optimist = require('optimist'); const codepainter = require('../codepainter'); var argv = optimist.options({ 'input': { alias: 'i', default: 'stdin', describe: 'File path to read from', type: 'string' }, 'output': { alias: 'o', default: 'stdout', describe: 'File path to write to', type: 'string' }, 'sample': { alias: 's', describe: 'Code sample path to infer the style from', type: 'string' }, // FIXME: Make it possible to specify this in a file. 'style': { describe: 'JSON string describing the coding style', type: 'string' } }).check(function (argv) { return typeof argv.sample !== 'undefined' || typeof argv.style !== 'undefined'; }).argv; var input; if (argv.input === 'stdin') { input = process.stdin; } else { input = fs.createReadStream(argv.input); input.pause(); } input.setEncoding('utf-8'); var output; if (argv.output === 'stdout') output = process.stdout; else output = fs.createWriteStream(argv.output); function transform(style) { codepainter.transform(input, style, output, function (error) { if (error) { console.error(error); return; } }); } if (typeof argv.style !== 'undefined') { var style = JSON.parse(argv.style); transform(style); } else { var sample; sample = fs.createReadStream(argv.sample); sample.pause(); sample.setEncoding('utf-8'); codepainter.infer(sample, function (error, style) { if (error) { console.error(error); return; } transform(style); }); }

plays3upload install failed.

ming@ming-laptop:~/.ssh$ ssh-keygen -t rsa -C "ming@katdc.com" Generating public/private rsa key pair. Enter file in which to save the key (/home/ming/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/ming/.ssh/id_rsa. Your public key has been saved in /home/ming/.ssh/id_rsa.pub. The key fingerprint is: 43:9f:90:a0:5c:2d:fb:93:b6:3c:fd:39:4d:ca:9c:dd ming@katdc.com The key's randomart image is: +--[ RSA 2048]----+ | o.. | | . o.... | | o o+ | | .. o . | | .S.o | | =. . | | o + o * . | | + . *.o E| | . .o. | +-----------------+ ming@ming-laptop:~/.ssh$ heroku keys:add Found existing public key: /home/ming/.ssh/id_rsa.pub Uploading ssh public key /home/ming/.ssh/id_rsa.pub ming@ming-laptop:~/.ssh$ cd ming@ming-laptop:~$ cd git ming@ming-laptop:~/git$ ls katdc-website node npm play playbars plays3upload vote4music ming@ming-laptop:~/git$ cd *website ming@ming-laptop:~/git/katdc-website$ ls app config.ru doc Gemfile.lock public README test config db Gemfile lib Rakefile script vendor ming@ming-laptop:~/git/katdc-website$ git push heroku master Agent admitted failure to sign using the key. Permission denied (publickey). fatal: The remote end hung up unexpectedly ming@ming-laptop:~/git/katdc-website$ ssh-add ~/.ssh/id_rsa Identity added: /home/ming/.ssh/id_rsa (/home/ming/.ssh/id_rsa) ming@ming-laptop:~/git/katdc-website$ git push heroku master Counting objects: 243, done. Delta compression using up to 2 threads. Compressing objects: 100% (167/167), done. Writing objects: 100% (243/243), 3.40 MiB | 279 KiB/s, done. Total 243 (delta 55), reused 243 (delta 55) -----> Heroku receiving push -----> Ruby/Rails app detected -----> Installing dependencies using Bundler version 1.1.rc.7 Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment Fetching gem metadata from http://rubygems.org/........ Installing rake (0.8.7) Installing abstract (1.0.0) Installing activesupport (3.0.5) Installing builder (2.1.2) Installing i18n (0.5.0) Installing activemodel (3.0.5) Installing erubis (2.6.6) Installing rack (1.2.2) Installing rack-mount (0.6.13) Installing rack-test (0.5.7) Installing tzinfo (0.3.25) Installing actionpack (3.0.5) Installing mime-types (1.16) Installing polyglot (0.3.1) Installing treetop (1.4.9) Installing mail (2.2.15) Installing actionmailer (3.0.5) Installing arel (2.0.9) Installing activerecord (3.0.5) Installing activeresource (3.0.5) Using bundler (1.1.rc.7) Installing thor (0.14.6) Installing railties (3.0.5) Installing rails (3.0.5) Installing sqlite3 (1.3.3) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks! /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /usr/local/bin/ruby extconf.rb checking for sqlite3.h... no sqlite3.h is missing. Try 'port install sqlite3 +universal' or 'yum install sqlite3-devel' and check your shared library search path (the location where your sqlite3 shared library is located). *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/local/bin/ruby --with-sqlite3-dir --without-sqlite3-dir --with-sqlite3-include --without-sqlite3-include=${sqlite3-dir}/include --with-sqlite3-lib --without-sqlite3-lib=${sqlite3-dir}/lib Gem files will remain installed in /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.3 for inspection. Results logged to /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions' from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each' from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions' from /usr/local/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/source.rb:90:in `block in install' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/rubygems_integration.rb:82:in `preserve_paths' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/source.rb:89:in `install' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:73:in `block in install_gem_from_spec' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/rubygems_integration.rb:97:in `with_build_args' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:72:in `install_gem_from_spec' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:56:in `block in run' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:55:in `run' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:12:in `install' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/cli.rb:220:in `install' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/task.rb:22:in `run' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor.rb:263:in `dispatch' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/base.rb:386:in `start' from /tmp/build_1fyfbl02lb26s/vendor/bundle/ruby/1.9.1/gems/bundler-1.1.rc.7/bin/bundle:13:in `' from vendor/bundle/ruby/1.9.1/bin/bundle:19:in `load' from vendor/bundle/ruby/1.9.1/bin/bundle:19:in `
' ! ! Failed to install gems via Bundler. ! ! Detected sqlite3 gem which is not supported on Heroku. ! http://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development ! ! Heroku push rejected, failed to compile Ruby/rails app To git@heroku.com:smooth-wind-1511.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'git@heroku.com:smooth-wind-1511.git'