Skip to content

Instantly share code, notes, and snippets.

View talbright's full-sized avatar
🏠
Working from home

Trent Albright talbright

🏠
Working from home
View GitHub Profile
package desk
import (
"fmt"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestJsonBuilder(t *testing.T) {
fmt.Println("")
package desk
import (
"github.com/lann/builder"
)
type StructA struct {
Name *string
}
//Not very DRY at all, there should be a better way...
type Case struct {
ID *int `json:"id,omitempty"`
ExternalID *string `json:"external_id,omitempty"`
Type *string `json:"type,omitempty"`
}
type caseBuilder builder.Builder
func (b caseBuilder) Build() Case {
return builder.GetStruct(b).(Case)
require 'uri'
require 'net/http'
class Chunked
def initialize(data, chunk_size)
@size = chunk_size
if data.respond_to? :read
@file = data
end
end
@talbright
talbright / diff
Created December 1, 2011 02:08
Working patch for ruby-git
diff --git a/lib/git/lib.rb b/lib/git/lib.rb
index 52fb2e6..b767fc9 100644
--- a/lib/git/lib.rb
+++ b/lib/git/lib.rb
@@ -124,37 +124,43 @@ module Git
end
def process_commit_data(data, sha = nil, indent = 4)
- in_message = false
-