Skip to content

Instantly share code, notes, and snippets.

View adelcambre's full-sized avatar

Andy Delcambre adelcambre

View GitHub Profile
++++++++++
[
>+++++++>++++++++++>+++>+<<<<-
] this loop set the next four cells to 70/100/30/10
>++. print 'H'
>+. print 'e'
+++++++. 'l'
. 'l'
+++. 'o'
>++. space
# use PathPrefix Middleware if :path_prefix is set in Merb::Config
if prefix = ::Merb::Config[:path_prefix]
use Merb::Rack::PathPrefix, prefix
end
# comment this out if you are running merb behind a load balancer
# that serves static files
use Merb::Rack::Static, Merb.dir_for(:public)
rush> git clone git://github.com/rails/rails.git
(eval):1: warning: parenthesize argument(s) for future version
(eval):1: warning: parenthesize argument(s) for future version
Exception NameError -> undefined local variable or method `github' for localhost:Rush::Box
/Library/Ruby/Gems/1.8/gems/rush-0.4/lib/rush/shell.rb:36:in `eval'
/Users/andy/projects/engineyard/diablo-rojo/(eval):1:in `initialize'
/Library/Ruby/Gems/1.8/gems/rush-0.4/bin/rush:6:in `new'
/Library/Ruby/Gems/1.8/gems/rush-0.4/bin/rush:6
/usr/bin/rush:19:in `load'
/usr/bin/rush:19
def get_archive_hash
counts = repository.adapter.query("SELECT COUNT(*) as count, #{specific_date_function} FROM articles WHERE published_at IS NOT NULL AND published = ? GROUP BY year, month ORDER BY year DESC, month DESC", true)
archives = counts.map do |entry|
{
:name => "#{Date::MONTHNAMES[entry.month.to_i]} #{entry.year}",
:month => entry.month.to_i,
:year => entry.year.to_i,
:article_count => entry.count
}
end
$(document).ready(function() {
$(".photo").each(function(i, e) {
$zoom_id = i + '_zoom';
$show_link = $('<a class="jquery_link">Toggle Photo</a>');
$show_link.click(function () { $(this).siblings('img').toggle() });
$(this).append($show_link);
if (($original = $(this).find(".original")).size() > 0) {
$zoom_link = $('<a class="jquery_link">Zoom</a>');
$zoom_div = $('<div class="zoom"><img class="dialog_img" src="' + $original.attr("href") + '"/></div>');
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'redcloth'
=> true
irb(main):005:0> a = RedCloth.new "_italic_ <pre><code>var a = 'blah';</code></pre> *bold*"
=> "_italic_ <pre><code>var a = 'blah';</code></pre> *bold*"
irb(main):006:0> a.to_html
=> "<p><em>italic</em> <pre><code>var a = 'blah';</code></pre> <strong>bold</strong></p>"
class BlahImporter
def self.import
soap = SOAP::WSDLDriverFactory.new(BLAH_WSDL_URL).create_rpc_driver
params = {
'param1' => "asdf",
'param2' => 123
}
res = soap.getSomethings(params)
From 49f2caef59e5c915d3fa12b3460b997878ee5b80 Mon Sep 17 00:00:00 2001
From: Andy Delcambre <[email protected]>
Date: Mon, 8 Sep 2008 15:30:36 -0700
Subject: [PATCH] typo in error state for create
---
salesforce/lib/dm-salesforce.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/salesforce/lib/dm-salesforce.rb b/salesforce/lib/dm-salesforce.rb
# Event hooks for plugins
before :create, :fire_before_create_event
before :update, :fire_before_update_event
before :save, :fire_before_save_event
after :create, :fire_after_create_event
after :update, :fire_after_update_event
after :save, :fire_after_save_event
# in the article view
<%= render_plugin_views @articles.nil? ? "after_article" : "after_article_in_list", :with => article %>
# in the plugin init
Hooks::View.register_partial_view "after_article", "comments"
# in lib/hooks/view.rb
# This returns an array of the available view hooks
def available_hooks
["first_article_in_list", "last_article_in_list", "before_article", "before_article_in_list", "after_article", "after_article_in_list", "article_form_fields", "between_articles", "meta_section", "head", "header", "before_layout", "after_layout", "sidebar", "footer"]