Skip to content

Instantly share code, notes, and snippets.

Dan McGrady dmix

Block or report user

Report or block dmix

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:10309
require 'rubygems'
require 'scrubyt'
Scrubyt.logger = Scrubyt::Logger.new
market_data = Scrubyt::Extractor.define do
fetch 'http://Salesforce.com/'
contents "/html/body"
end
puts market_data.to_xml
market_data = Scrubyt::Extractor.define do
fetch 'http://www.salesforce.com/products/sales-force-automation/sales-management/'
View gist:19464
# url has been changed for privacy reasons
upstream site.ca {
server 127.0.0.1:5000;
server 127.0.0.1:5001;
server 127.0.0.1:5002;
}
server {
listen 80;
server_name www.site.ca;
View dev build error
[jar] Warning: com\xruby\runtime\lang\RhoSupport$3.class modified in the f
uture.
[jar] Warning: com\xruby\runtime\lang\RhoSupport.class modified in the fut
ure.
[jar] Warning: com\xruby\runtime\lang\RubyBinding.class modified in the fu
ture.
[jar] Warning: com\xruby\runtime\lang\RubyClass_Methods$1.class modified i
n the future.
[jar] Warning: com\xruby\runtime\lang\RubyClass_Methods$2.class modified i
View gist:175252
(require 'swank.swank)
(swank.swank/ignore-protocol-version "2009-08-21")
(swank.swank/start-server "/var/folders/Zr/Zr7HlWJOH6u70-SiHGLqWE+++TI/-Tmp-/slime.2838" :encoding "iso-latin-1-unix")
Clojure 1.0.0--SNAPSHOT
user=> (require 'swank.swank)
java.io.FileNotFoundException: Could not locate swank/swank__init.class or swank/swank.clj on classpath: (NO_SOURCE_FILE:0)
User=>
View gist:175255
(add-to-list 'load-path "~/.emacs.d/vendor/clojure-mode")
(autoload 'clojure-mode "clojure-mode" "A major mode for Clojure" t)
(add-to-list 'auto-mode-alist '("\\.clj$" . clojure-mode))
;; Slime
(add-to-list 'load-path "~/.emacs.d/vendor/slime")
(require 'slime)
(slime-setup)
(add-to-list 'load-path "~/.emacs.d/vendor/swank-clojure")
View gist:177087
dan-mcgradys-macbook-2 ~/clojure/clj-apache-http: ant -Dclojure.jar="~/Library/Clojure/lib/clojure.jar" -Dclojure.contrib.jar="~/Library/Clojure/lib/clojure-contrib.jar
> "
Buildfile: build.xml
init:
[mkdir] Created dir: /Users/dmix/clojure/clj-apache-http/classes
[mkdir] Created dir: /Users/dmix/clojure/clj-apache-http/deploy
compile_clojure:
View gist:177119
Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.Namespace.importClass(Ljava/lang/Class;)Ljava/lang/Class; (twitter.clj:0)
at clojure.lang.Compiler.eval(Compiler.java:4543)
at clojure.lang.Compiler.load(Compiler.java:4857)
at clojure.lang.Compiler.loadFile(Compiler.java:4824)
at clojure.main$load_script__5833.invoke(main.clj:206)
at clojure.main$init_opt__5836.invoke(main.clj:211)
at clojure.main$initialize__5846.invoke(main.clj:239)
at clojure.main$null_opt__5868.invoke(main.clj:264)
at clojure.main$legacy_script__5883.invoke(main.clj:295)
at clojure.lang.Var.invoke(Var.java:346)
View gist:179913
def init_nav
# form: { :section => [ [ :pageA, :pageB ], :option1, :option2 ] }
@nav = [
{ :company => [ [ :who_we_are, :clients, :careers ] ] },
{ :approach => [ [ :methodology, :technologies ], :testimonials ] },
{ :solutions => [ [ :business_solutions, :product_development, :managed_hosting ], :testimonials ] },
{ :labs => [ [ :projects, :open_source ] ] },
{ :contact => [ [ :contact_us ] ] }
]
View gist:248808
#live_validations_controller.rb
class LiveValidationsController < ApplicationController
def validate_username
if params[:username].length > 3
@user = User.find_by_username(params[:username])
if @user.nil?
@message = "<img src='/images/accept.png' alt='Valid Username'/>"
else
@message = "<img src='/images/cross.png' alt='Invalid Username' /> Name taken"
View gist:248809
<!-- _message.html.erb -->
<%= @message %>
You can’t perform that action at this time.