Skip to content

Instantly share code, notes, and snippets.

View jasonLaster's full-sized avatar

Jason Laster jasonLaster

View GitHub Profile
create_command 'debug' do
description 'Debug method call.'
banner <<-BANNER
Usage: debug foo(bar)
step inside method invocation.
BANNER
unless Object.const_defined? 'PryDebugger'
$:.unshift File.expand_path '../../lib', __FILE__
$:.unshift File.expand_path '../../../pry/lib', __FILE__
$:.unshift File.expand_path '../../../pry-stack_explorer/lib', __FILE__
require 'pry-debugger'
end
def a()
b
@jasonLaster
jasonLaster / gist:3318076
Created August 10, 2012 21:19
rubinius install
[2012-08-10 17:01:31] /Users/quintessentialbum/.rvm/wrappers/ree-1.8.7-head/ruby ./configure --prefix=/Users/quintessentialbum/.rvm/rubies/rbx-head --with-opt-dir=/Users/quintessentialbum/.rvm/usr
Checking gcc: found
Checking g++: found
Checking bison: found
Configuring LLVM...
Checking for existing LLVM library tree: not found.
Checking for 'llvm-config': not found
Checking for prebuilt LLVM package...
Downloading llvm-3.0-x86_64-apple-darwin12.0.0.tar.bz2...
/Users/quintessentialbum/.rvm/rubies/ree-1.8.7-head/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault
@jasonLaster
jasonLaster / configure.log
Created August 11, 2012 03:50
Problem isntalling rubinius
~ rvm install rbx-head
rbx-head installing #dependencies
Warning: URL was not passed to __rvm_check_for_tarball
Cleaning git repo
Fetching from origin
Pulling from origin master
Copying from repo to source...
rbx-head - #configuring
Error running '/Users/quintessentialbum/.rvm/wrappers/ree-1.8.7-head/ruby ./configure --prefix=/Users/quintessentialbum/.rvm/rubies/rbx-head --with-opt-dir=/Users/quintessentialbum/.rvm/usr ', please read /Users/quintessentialbum/.rvm/log/rbx-head/configure.log
There has been an error while running '/Users/quintessentialbum/.rvm/wrappers/ree-1.8.7-head/ruby ./configure --prefix=/Users/quintessentialbum/.rvm/rubies/rbx-head --with-opt-dir=/Users/quintessentialbum/.rvm/usr '.
i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
require 'rbconfig'
unless Object.const_defined? 'Pry'
$:.unshift File.expand_path '../../lib', __FILE__
require 'pry'
end
# Constant
module Mod
Con = 'Constant'
module Mod2
➜ pry git:(tabcomplete) ✗ rvm list
rvm rubies
=> /Users/quintessentialbum/.rvm/scripts/list: line 294: /Users/quintessentialbum/.rvm/rubies/rbx-head/config: No such file or directory
rbx-head [ ]
/Users/quintessentialbum/.rvm/scripts/list: line 294: /Users/quintessentialbum/.rvm/rubies/rbx-head-19mode/config: No such file or directory
rbx-head-19mode [ ]
ree-1.8.7-head [ i686 ]
ruby-1.9.2-p180 [ x86_64 ]
@jasonLaster
jasonLaster / config.log
Created August 26, 2012 22:49
llvm fails to install on mac osx
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by llvm configure 3.0, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ ./configure --prefix=/usr/local/Cellar/llvm/3.0 --enable-optimized --enable-bindings=none --enable-targets=host-only
## --------- ##
## Platform. ##
@jasonLaster
jasonLaster / load.md
Created September 6, 2012 16:19
Check to see when js has been loaded

It's possible to use the standard onload event for some dom element.

<element onload="SomeJavaScriptCode">

<body>, <frame>, <frameset>, <iframe>, <img>, <input type="image">, <link>, <script>, <style>

It's possible to programmatically add an onload eventlistener to several objects in JS.

@jasonLaster
jasonLaster / to_block.md
Created September 23, 2012 20:51
string transposition

I completely agree with you that my to_block method for transposing strings lacked clarity. It actually began as this ruby doozy of a line.

def to_block1(lines)
  lines.map!(&:chars).shift.zip(&:lines).map(&:join)
end

Ideally, I would like the answer to be as simple as lines.zip, which would just transpose the line chars. Unfortunately, ruby strings are not enumerable and zip expects to be called on the first enumerable and passsed the 2nd through nth enumerable.