Skip to content

Instantly share code, notes, and snippets.

View dcrosby42's full-sized avatar

David Crosby dcrosby42

  • Cisco Systems, Inc.
  • Grand Rapids MI
View GitHub Profile
@dcrosby42
dcrosby42 / myGRcitypoints issue #2
Created March 9, 2011 15:37
Vendor "Wes" cannot submit vendor info.
System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result
@dcrosby42
dcrosby42 / hex_string_example_uses.rb
Created July 6, 2011 04:58
Example uses of HexString, extracted from README.md
# Load HexString and automatically extend String:
require 'hex_string'
# Convert data to human-readable hex tuples:
>> "hello".to_hex_string
=> "68 65 6c 6c 6f"
# Compact a hex string into its data equivalent:
>> "77 6f 72 6c 64".to_byte_string
=> "world"
@dcrosby42
dcrosby42 / hex_string_example_uses.rb
Created July 6, 2011 05:18
Example uses of HexString, extracted from README.md
# Load HexString and automatically extend String:
require 'hex_string'
# Convert data to human-readable hex tuples:
>> "hello".to_hex_string
=> "68 65 6c 6c 6f"
# Compact a hex string into its data equivalent:
>> "77 6f 72 6c 64".to_byte_string
=> "world"
@dcrosby42
dcrosby42 / CrozSpecialObjectionModule.m
Created July 21, 2011 15:52
Imple of objection module .m
#import "CrozSpecialObjectionModule.h"
@implementation CrozSpecialObjectionModule
@synthesize window = _window;
- (id) initWithWindow:(UIWindow *)window {
if ((self = [super init])) {
_window = [window retain];
}
return self;
@dcrosby42
dcrosby42 / CrozSpecialObjectionModule.h
Created July 21, 2011 15:50
Imple of objection module
#import <Foundation/Foundation.h>
@interface CrozSpecialObjectionModule : ObjectionModule {
UIWindow *_window;
}
@property (nonatomic, readonly, retain) IBOutlet UIWindow *window;
- (id) initWithWindow:(UIWindow *)window;
@end
#import "SpecHelper.h"
#import "CrozSpecialObjectionModule.h"
SPEC_BEGIN(CrozSpecialObjectionModuleSpec)
describe(@"ClassName", ^{
__block CrozSpecialObjectionModule *target = nil;
__block UIWindow *window = nil;
beforeEach(^{
@dcrosby42
dcrosby42 / CrozSpecialAppDelegate.m
Created July 21, 2011 16:22
App delegate implementation
//
// CrozSpecialAppDelegate.m
// CrozSpecial
//
// Created by David Crosby on 7/21/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "CrozSpecialAppDelegate.h"
#import "CrozSpecialObjectionModule.h"
@dcrosby42
dcrosby42 / mk_arduino_tags.sh
Created July 25, 2011 03:18
Shell script to generate Arduino ctags
ctags -f tags.cpp `find . -name "*.cpp" -o -name "*.h"`
ctags -f tags.pde --langmap=c++:.pde `find . -name "*.pde"`
cat tags.cpp tags.pde > tags
sort tags -o tags
rm -f tags.*
@dcrosby42
dcrosby42 / Rakefile
Created July 25, 2011 03:17
Rakefile for generating Arduino ctags
desc "Generate Arduino code tags"
task :tags do
sh %{ctags -f tags.cpp `find . -name "*.cpp" -o -name "*.h"`}
sh %{ctags -f tags.pde --langmap=c++:.pde `find . -name "*.pde"`}
sh %{cat tags.cpp tags.pde > tags}
sh %{sort tags -o tags}
rm_f Dir["tags.*"]
end
@dcrosby42
dcrosby42 / patiently_sample1_spec.rb
Created March 22, 2012 02:04
Sample of using FirePoll.patiently in a web spec
patiently do
page.should have_content("Task Table")
page.should have_selector(".row:nth-child(1)", text: "Ride to work")
page.should have_selector(".row:nth-child(2)", text: "Write some code")
page.should have_selector(".row:nth-child(3)", text: "Go to The Meanwhile")
end