Skip to content

Instantly share code, notes, and snippets.

View docwhat's full-sized avatar

Christian Höltje docwhat

View GitHub Profile
We couldn’t find that file to show.
Fork this and add your example
@docwhat
docwhat / source_me.bash
Created December 3, 2010 00:19
A simple thingy for Andrew
# This sets up the functions needed to make this work.
DG_DIR="${HOME}/.drewgo"
# Shows the list of saved directories.
function dg_show {
if [[ -r "${DG_DIR}/directories" ]]; then
cat "${DG_DIR}/directories"
else
echo "You haven't added anything yet."
@HEAD
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response HEAD(@PathParam("token") String token,
@DefaultValue("0") @FormParam("id") Number id)
throws JsonGenerationException, JsonMappingException, IOException {
EditSession session = AppState.INSTANCE.getEditSession(token);
Number change_id = session.getChangeId();
boolean has_changed = change_id != id;
org.ofbiz.core.entity.GenericDataSourceException: Generic Entity Exception occurred in deleteByAnd (SQL Exception while executing the following:DELETE FROM label WHERE FIELDID IS NULL AND ISSUE=? (Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'))
---
tab_widths:
Default: 2
Plain Text: 2
Ruby on Rails: 2
YAML: 2
RSpec: 2
Ruby: 2
softnesses:
Default: true
@docwhat
docwhat / rails31init.md
Created September 3, 2011 03:01 — forked from niquola/rails31init.md
Rails 3.1 with Rspec, Factory Girl, Haml, Database Cleaner, Spork, and Guard

Install Rails 3.1

gem install rails

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@docwhat
docwhat / pry.rb
Created September 8, 2011 14:41
Enable pry for `rails c`
# config/initializers/pry.rb
#
# Don't forget to add this to your Gemfile:
# gem 'pry', :group => [:development, :test]
#
begin
require 'pry'
module Rails
class Console
class IRB
require 'spec_helper'
describe MywidgetWidget do
has_widgets do |root|
root << widget(:mywidget)
end
it "says hello world" do
render_widget :mywidget
@docwhat
docwhat / gist:1243341
Created September 26, 2011 20:44
creates problem.
diff --git a/spec/rspec-apotomo/widget_example_group_spec.rb b/spec/rspec-apotomo/widget_example_group_spec.rb
index 9390bcc..95dc5eb 100644
--- a/spec/rspec-apotomo/widget_example_group_spec.rb
+++ b/spec/rspec-apotomo/widget_example_group_spec.rb
@@ -5,6 +5,10 @@ require 'rspec/rails/example/widget_example_group'
# This class is used as a dummy widget for testing
class DummyWidget < Apotomo::Widget
responds_to_event :doo
+
+ def display