This file contains 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
Here's an example of how I was able to use the rsp from Smart.app to run on a different | |
port at the same time. It would be nice if this ability was built into the GUI app, but | |
for now, I hacked it. | |
I made a directory for my app here: | |
/Users/jim/joyent/rsp/local-smartasks | |
I put the application source in a subdirectory called '127.0.0.1'. So the bootstrap.js is | |
at /Users/jim/joyent/rsp/local-smartasks/127.0.0.1/js/bootstrap.js |
This file contains 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
cd src/ | |
wget http://puzzle.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz | |
tar xzvf libmcrypt-2.5.8.tar.gz | |
cd libmcrypt-2.5.8 | |
MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --disable-dependency-tracking | |
make -j6 | |
sudo make install | |
$ php --version | |
PHP 5.3.0 (cli) (built: Jul 19 2009 00:34:29) |
This file contains 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
require 'irb/completion' | |
require 'irb/ext/save-history' | |
ARGV.concat [ "--readline", "--prompt-mode", "simple" ] | |
IRB.conf[:SAVE_HISTORY] = 100 | |
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" | |
This file contains 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
require 'net/http' | |
module Net | |
class BufferedIO | |
def rbuf_fill | |
timeout(@read_timeout, ProtocolError) { | |
@rbuf << @io.sysread(1024) | |
} | |
end | |
end | |
end |
This file contains 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
# Run before specs with: | |
# ruby spec_service.rb -p 4000 | |
# Sinatra application to provide dm-rest-adapter an end-point: | |
require 'rubygems' | |
require 'sinatra' | |
require 'dm-core' | |
require 'dm-serializer' | |
# Note that we cannot wrap this stuff into a 'before' block |
This file contains 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
require "yaml" | |
require "irb" | |
require Pathname("irb/completion") | |
# TODO: error handling for: | |
# missing adapter, host or database | |
module DataMapper | |
class CLI | |
This file contains 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
require 'rubygems' | |
require 'extlib' | |
module Extlib | |
module Inflection | |
class << self | |
# Take a complete module/class name and returns the scope where that module/class has been defined: | |
# | |
# @example | |
# module_scope("ActiveRecord::CoreExtensions::String::Inflections") #=> "ActiveRecord::CoreExtensions::String" |
This file contains 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 'rubygems' | |
gem 'dm-core', '>=0.9.10' | |
require 'dm-core' | |
DataMapper::Logger.new(STDOUT, :debug) | |
DataMapper.setup(:default, 'sqlite3::memory:') | |
module Foo |
This file contains 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
" Use Vim settings, rather then Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
" allow backspacing over everything in insert mode | |
set backspace=indent,eol,start | |
set background=dark | |
set title " set xterm title | |
set history=1000 " keep 1000 lines of command line history |
This file contains 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
require 'sinatra/base' | |
module Sinatra | |
# Use from classic "top-level" applications with: | |
# require 'sinatra' | |
# require 'sinatra/extension_template' | |
# | |
# Use from modular applications with: | |
# require 'sinatra/base' | |
# require 'sinatra/extension_template' |
NewerOlder