This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'uri' | |
require 'net/http' | |
class Chunked | |
def initialize(data, chunk_size) | |
@size = chunk_size | |
if data.respond_to? :read | |
@file = data | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package desk | |
import ( | |
"github.com/lann/builder" | |
) | |
type StructA struct { | |
Name *string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package desk | |
import ( | |
"fmt" | |
"testing" | |
. "github.com/smartystreets/goconvey/convey" | |
) | |
func TestJsonBuilder(t *testing.T) { | |
fmt.Println("") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers | |
ActiveSupport::Notifications.subscribe /fragment.action_controller/ do |*args| | |
event = ActiveSupport::Notifications::Event.new *args | |
Rails.logger.info "Notification for event #{event.name} with payload #{event.payload}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
action_base = ActionController::Base.new | |
key = "en/handlebars_ticket_filter_show_v2/ssl:false" | |
action_base.fragment_exist?(key) | |
action_base.read_fragment(key) | |
action_base.fragment_cache_key(key) # shows how Rails modifies the key before storage see ActiveSupport::Cache.expand_cache_key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/elasticsearch_transition.rb | |
# Both elasticsearch-0.4.11 and rubberband-0.1.6 use 'elasticsearch' | |
# in their respective gem lib dirs. This causes the elasticsearch gem | |
# to incorrectly require same named paths from the wrong gem (in this | |
# case from rubberband). That's because rubberband is in the require | |
# path first. | |
# | |
# You have to set require: false in your Gemfile for the | |
# elasticsearch gems. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'yaml' | |
require 'zlib' | |
starting_bound = 368_796_583 | |
ending_bound = 999_999_999 | |
integers = [] | |
ARGV[0].to_i.times { |x| integers << rand(starting_bound..ending_bound) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ensures mtimes are consistent with the git commit to utilize ADD caching | |
# Re-written from https://github.com/docker-library/official-images/blob/1dd9118804a06fef308e613cdbabe44bf0529043/bashbrew/git-set-mtimes | |
# This version is more platform compatible (assuming you have ruby), works on os x and *nix | |
git_set_mtimes() { | |
pushd $1 | |
IFS=$'\n' | |
files=( $({ git ls-files | xargs dirname | sort -u && git ls-files; } | sort -r) ) | |
unset IFS | |
for f in "${files[@]}"; do | |
stamp="$(git --no-pager log -1 --format='format:%ai' -- "$f")" |
OlderNewer