Skip to content

Instantly share code, notes, and snippets.

@rubys
rubys / gist:5801817
Created June 18, 2013 00:48
live stream hang failure
xml.products do
@products.each do |product|
xml.product do
xml.title product.title
end
end
end
@rubys
rubys / gist:5801812
Created June 18, 2013 00:46
live stream hang failure
class ProductsController < ApplicationController
before_action :set_product, only: [:show, :edit, :update, :destroy]
include ActionController::Live
before_action :authorize, only: [:edit, :destroy]
# GET /products
# GET /products.json
def index
@products = Product.all
end
@rubys
rubys / gist:5715383
Last active December 18, 2015 02:59
require 'rubygems'
require 'gorp/test'
class BasicRailsTest < Gorp::TestCase
test "basic functionality" do
desc 'Create the application.'
rails 'depot'
desc 'Create a simple resource.'
unless File.exists?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
ruby-2.0.0-p0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Log file: /usr/local/rvm/log/ruby-2.0.0-p0/gemsets.initial.log
[2013-03-26 15:43:43] __rvm_with
__rvm_with ()
{
( __rvm_use "$1";
shift;
"$@" || return $? )
}
current path: /usr/local/rvm/src/ruby-2.0.0-p0
$ rvm requirements
Installing requirements for ubuntu, might require sudo password.
Running 'apt-get --quiet --yes update' would require sudo.
Cowardly refusing to continue, please read 'rvm autolibs'.
Updating repositories
Missing required packages: libgdbm-dev, libffi-dev.
Cowardly refusing to continue, please read 'rvm autolibs'.
$ sudo rvm requirements
[sudo] password for rubys:
$ rvm ruby-head-n39832
$ gem list mysql2
*** LOCAL GEMS ***
mysql2 (0.3.11)
$ ruby -r mysql2 -e 0
$
$ rvm ruby-head-n39842
$ gem list mysql2
*** LOCAL GEMS ***
mysql2 (0.3.11)
Go to http://connect.apple.com
Download and install the latest (January 2013) Command Line Tools for Xcode
for your operating system (OS X Lion or OS X Mountain Lion).
\curl -L https://get.rvm.io | bash
check for, and follow, any Upgrade Notes in the output from that command.
rvm install 2.0.0 --autolibs=3
Index: submit-account-request.rb
===================================================================
--- submit-account-request.rb (revision 800677)
+++ submit-account-request.rb (working copy)
@@ -81,6 +81,9 @@
# add the list of userids that are pending
taken += File.read(REQUESTS).scan(/^(\w.*?);/).flatten
+# add member ids that do not have ICLAs
+taken += %w(andi andrei arved dgaudet pcs rasmus ssb zeev)
#!/usr/bin/ruby
$SAFE = 1
print "Content-type: text/plain\r\n\r\n"
Dir.chdir ENV['DOCUMENT_ROOT'] do
print ENV['DOCUMENT_ROOT']
end