View index.html
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
<h1>Upload Documents</h1> | |
<form action="/documents" enctype="multipart/form-data" id="fileupload" method="post"> | |
<input type="file" name="document[attachment][]" multiple="multiple"> | |
<table> | |
<tbody id="files" class="files"></tbody> | |
</table> | |
</form> | |
<!-- jQuery 1.8.3 already included --> |
View websocket_server.rb
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' # I'm getting this error when I try to run this file: | |
require 'em-websocket' # websocket_server.rb:62: syntax error, unexpected $end, expecting keyword_end | |
require 'json' | |
class ChatMessage | |
attr_accessor :type, :username, :message | |
def initialize(msg_json) | |
msg = JSON.parse(msg_json) |
View sample.rb
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
# This is all mostly working except for the "on_message" class method. | |
# It needs to set the regex and block as a variable that can be accessed later from an instance of the class. | |
class MyExtension < ExtensionBase | |
on_message '/join (.+)' do |username| | |
# this will be a callback function used later | |
end | |
end |
View AppDelegate.rb
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
framework "WebKit" | |
class AppDelegate | |
attr_accessor :window | |
def applicationDidFinishLaunching(notification) | |
load_web_view | |
end | |
def load_web_view |
View gist:1573056
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
<table class="tablesorter"> | |
<thead> | |
<tr> | |
<th>name</th> | |
</tr> | |
</thead> | |
<tbody> | |
<!-- group 1 --> | |
<tr class="top"> |
View spec_helper.rb
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 'simplecov' | |
SimpleCov.start | |
require 'my_gem' | |
require 'rspec/mocks' | |
RSpec.configure do |config| | |
config.mock_framework = :rspec | |
end |
View gist:2023640
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
$ brew install -v redis | |
==> Downloading http://redis.googlecode.com/files/redis-2.4.8.tar.gz | |
File already downloaded in /Users/andrew/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/andrew/Library/Caches/Homebrew/redis-2.4.8.tar.gz | |
==> make -C src | |
make -C src | |
MAKE hiredis | |
CC ae.o | |
CC anet.o | |
CC redis-benchmark.o |
View Bootstrap.php
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
<?php | |
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
protected function _initCustomRoutes() | |
{ | |
$router = Zend_Controller_Front::getInstance()->getRouter(); | |
$route = new Mylib_Controller_Router_Route_Redirect('old/route/*', array('controller'=>'content', 'action'=>'index')); | |
$router->addRoute('old_route', $route); | |
} |
View gist:3902832
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
/Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-websocket-0.4.6/lib/faye/adapters/thin.rb:26:in `<top (required)>': cannot load such file -- thin/connection (LoadError) | |
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-websocket-0.4.6/lib/faye/websocket.rb:66:in `require' | |
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-websocket-0.4.6/lib/faye/websocket.rb:66:in `load_adapter' | |
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-websocket-0.4.6/lib/faye/websocket.rb:214:in `block in <top (required)>' | |
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-websocket-0.4.6/lib/faye/websocket.rb:212:in `each' | |
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-websocket-0.4.6/lib/faye/websocket.rb:212:in `<top (required)>' | |
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-0.8.6/lib/faye.rb:7:in `require' | |
from /Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-0.8.6/lib/faye.rb:7:in `<top (required)>' |
View gist:3902804
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
2012-10-16 16:42:22 [ERROR] [Faye::RackAdapter] undefined method `call' for nil:NilClass | |
Backtrace: | |
/Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-0.8.6/lib/faye/adapters/rack_adapter.rb:121:in `block in handle_request' | |
/Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-0.8.6/lib/faye/protocol/server.rb:46:in `call' | |
/Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-0.8.6/lib/faye/protocol/server.rb:46:in `block in process' | |
/Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-0.8.6/lib/faye/protocol/server.rb:58:in `call' | |
/Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-0.8.6/lib/faye/protocol/server.rb:58:in `block (3 levels) in process' | |
/Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-0.8.6/lib/faye/protocol/extensible.rb:23:in `call' | |
/Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-0.8.6/lib/faye/protocol/extensible.rb:23:in `pipe_through_extensions' | |
/Users/andrew/.rvm/gems/ruby-1.9.3-p194/gems/faye-0.8.6/lib/faye/protocol/server.rb:55:in `block (2 levels) in process' |
OlderNewer