Skip to content

Instantly share code, notes, and snippets.

View yfeldblum's full-sized avatar

Jay Feldblum yfeldblum

  • Meta
  • San Jose, CA
View GitHub Profile
# cookbooks/keymaster/libraries/decrypt.rb
module Keymaster
module_function
def decrypt_data_bag_item(item)
Chef::Log.info("yeah !")
end
end
# cookbooks/whatever/metadata.rb
require "mongo"
require "open-uri"
require "mime/types"
require "digest/md5"
class Upload
##
#
include Mongoid::Document
include Mongoid::Timestamps
@yfeldblum
yfeldblum / grid_fs.rb
Created July 15, 2012 16:36 — forked from ahoward/grid_fs.rb
implementation of grid_fs on top of mongoid
require "mime/types"
require "digest/md5"
require "cgi"
### see: http://www.mongodb.org/display/DOCS/GridFS+Specification
class GridFS
##
#
attr_accessor :prefix
original_pear_version = nil
ruby_block "check_pear_version" do
block do
original_pear_version = %x[ pear -V 2>&1 ].match(/PEAR.*(\d+\.\d+\.\d+)/)[1]
original_pear_version = Gem::Version.create(original_pear_version)
end
end
declared_pear_version = Gem::Version.create("1.6.1")
@yfeldblum
yfeldblum / 0-readme.md
Created January 28, 2012 16:50 — forked from burke/0-readme.md
ruby-1.9.3-p0 cumulative performance patch.

Patched ruby 1.9.3-p0 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p0 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).

Huge thanks to funny-falcon for the performance patches.

@yfeldblum
yfeldblum / backport_gc.patch
Created January 27, 2012 12:10 — forked from funny-falcon/backport_gc.patch
Backport new GC for ruby-1.9.3-p0
diff --git a/ChangeLog b/ChangeLog
index c4ea779..0a6bf73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,188 @@
+Tue Jan 17 12:32:46 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (aligned_malloc, aligned_free): covered missing defined
+ operators and fixes for cygwin.
+
@yfeldblum
yfeldblum / cumulative_performance.patch
Created January 23, 2012 14:55 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p0 cumulative performance patch.
diff --git a/common.mk b/common.mk
index ea244cc..4f22609 100644
--- a/common.mk
+++ b/common.mk
@@ -629,7 +629,8 @@ file.$(OBJEXT): {$(VPATH)}file.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
gc.$(OBJEXT): {$(VPATH)}gc.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
{$(VPATH)}regex.h $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
{$(VPATH)}gc.h {$(VPATH)}io.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
- {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}constant.h
+ {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}constant.h \
@yfeldblum
yfeldblum / hash_optimize.patch
Created December 23, 2011 13:58 — forked from funny-falcon/hash_optimize.patch
Hash optimize patch (1.9.3-p0)
diff --git a/common.mk b/common.mk
index ea244cc..de09d9a 100644
--- a/common.mk
+++ b/common.mk
@@ -692,7 +692,8 @@ signal.$(OBJEXT): {$(VPATH)}signal.c $(RUBY_H_INCLUDES) \
$(VM_CORE_H_INCLUDES) {$(VPATH)}debug.h
sprintf.$(OBJEXT): {$(VPATH)}sprintf.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
{$(VPATH)}regex.h {$(VPATH)}vsnprintf.c $(ENCODING_H_INCLUDES)
-st.$(OBJEXT): {$(VPATH)}st.c $(RUBY_H_INCLUDES)
+st.$(OBJEXT): {$(VPATH)}st.c $(RUBY_H_INCLUDES) {$(VPATH)}pool_alloc.inc.h \
@yfeldblum
yfeldblum / cached_lp_sorted_lf.patch
Created December 20, 2011 20:27 — forked from funny-falcon/cached_lp_sorted_lf.patch
Cumulative: Sorted loaded features + Cached load path (against 1.9.3-p0)
diff --git a/file.c b/file.c
index 81f28ff..6aad4b0 100644
--- a/file.c
+++ b/file.c
@@ -2819,6 +2819,20 @@ ntfs_tail(const char *path)
buflen = RSTRING_LEN(result),\
pend = p + buflen)
+#define EXPAND_PATH()\
+ if ( !(abs_mode & FEP_DIR_EXPANDED) ) { \
Mongoid.identity_map_enabled = true
class Post
include Mongoid::Document
belongs_to :blog
end
class Blog
include Mongoid::Document