Skip to content

Instantly share code, notes, and snippets.

View No gem for me
C:\Ruby>gem install devise --platform=ruby
Building native extensions. This could take a while...
ERROR: Error installing devise:
ERROR: Failed to build gem native extension.
C:/Ruby/bin/ruby.exe extconf.rb
creating Makefile
'make' is not recognized as an internal or external command,
View dk.rb init
C:\RubyDevKit>ruby dk.rb init
Initialization complete! Please review and modify the auto-generate
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.
View config.yml
# This configuration file contains the absolute path locations of all
# installed Rubies to be enhanced to work with the DevKit. This config
# file is generated by the 'ruby dk.rb init' step and may be modified
# before running the 'ruby dk.rb install' step. To include any installed
# Rubies that were not automagically discovered, simply add a line below
# the triple hyphens with the absolute path to the Ruby root directory.
# Example:
# ---
View dk.rb review
C:\RubyDevKit>ruby dk.rb review
Based upon the settings in the 'config.yml' file generated
from running 'ruby dk.rb init' and any of your customizations,
DevKit functionality will be injected into the following Rubies
when you run 'ruby dk.rb install'.
C:/Ruby/lib/ruby/1.9.1/syck.rb:135:in `load': syntax error on line 16, col -2:
' (ArgumentError)
from C:/Ruby/lib/ruby/1.9.1/syck.rb:135:in `load'
from dk.rb:151:in `block in review'
View GemMe
C:\RubyDevKit>gem install devise --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed bcrypt-ruby-2.1.2
Successfully installed devise-1.1.3
2 gems installed
Installing ri documentation for bcrypt-ruby-2.1.2...
Installing ri documentation for devise-1.1.3...
Installing RDoc documentation for bcrypt-ruby-2.1.2...
Installing RDoc documentation for devise-1.1.3...
View gist:720600
def twitter_search(query,rpp,search_day)
base_url = ""
url = "#{base_url}?q=#{URI.encode(query)}\&rpp=#{rpp}&since=#{search_day}&until=#{search_day}"
data = Net::HTTP.get_response(URI.parse(url)).body
result = JSON.parse(data)
View gist:720604
def index
@search_results = twitter_search('SEARCH KEYWORDS HERE', 10,"%Y-%m-%d"))
View gist:720606
<%for result in @search_results %>
<td><%= auto_link(CGI::unescapeHTML(result["text"])) %></td>
<td><i>(Follow <a href="<%= result["from_user"] %>">
<%= result["from_user"]%> </a>)</i></td>
<% end %>
joesavak / gist:730902
Created Dec 6, 2010
Get files over HTTP
View gist:730902
for (i = 0; i < _numFiles; i++) {
try {
//get the next file name
fileName = _fileList[i].substring(_fileList[i].lastIndexOf("/")+1);
//associate file (URL) with the httpMethod
HttpMethod getXMLFile = new GetMethod(
//go get the file
_filehttp.executeMethod(getXMLFile );
//header info is useful (modified d/ts & size) -
View gist:730939
<building address="123 Main Street">Main</building>
<legal name="Main Street productions"/>
<manager empID=456>Bob Smith</manager>
<employee empID=987>Margie Jones</employee>
<employee empID=721 role="SysAdmin">John Johnson</employee>