Skip to content

Instantly share code, notes, and snippets.

View cgriego's full-sized avatar

Chris Griego cgriego

  • Priceline Partner Solutions
  • Portland, Oregon Metro Area
  • 07:57 (UTC -07:00)
  • X @cgriego
View GitHub Profile
// I want to unset comments.moderated for embedded document in the whole collection
{
"_id" : ObjectId("4cb7f2d5fe38855e43897d13"),
"title" : "Blog Examples Considered Harmful",
"comments" : [
{
"by" : "Bob",
"moderated" : true,
"text" : "first!"
},
[Mon, 16 Aug 2010 16:50:08 -0700] ERROR: execute[start sysklogd] (/etc/chef/recipes/cookbooks/sysklogd/recipes/default.rb line 1) had an error:
/etc/init.d/sysklogd start returned 1, expected 0
---- Begin output of /etc/init.d/sysklogd start ----
STDOUT: * ERROR: sysklogd is already starting.
STDERR:
---- End output of /etc/init.d/sysklogd start ----
# /etc/mysql/my.cnf: The global mysql configuration file.
# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/my.cnf-4.1,v 1.3 2006/05/05 19:51:40 chtekk Exp $
# The following options will be passed to all MySQL clients
[client]
port = 3306
[mysql]
character-sets-dir=/usr/share/mysql/charsets
default-character-set=utf8
class Chef
class Recipe
def has_gem?(name, version=nil)
if !$GEM_LIST
gems = {}
`gem list --local`.each_line do |line|
gems[$1.to_sym] = $2.split(/, /) if line =~ /^(.*) \(([^\)]*)\)$/
end
$GEM_LIST = gems
end
From 14c3cd15dd0f50dc02fcfa1a01ad93c723bba36d Mon Sep 17 00:00:00 2001
From: Chris Griego <cgriego@gmail.com>
Date: Tue, 4 May 2010 17:05:42 -0500
Subject: [PATCH] Fix halting callbacks
---
lib/mongoid/persistence.rb | 3 ++-
lib/mongoid/persistence/insert.rb | 3 +--
2 files changed, 3 insertions(+), 3 deletions(-)
def detect(path)
git = File.directory?(File.join(path, '.git'))
svn = File.directory?(File.join(path, '.svn'))
hg = File.directory?(File.join(path, '.hg'))
bzr = File.directory?(File.join(path, '.bzr'))
case [git, svn, hg, bzr]
when [true, false, false, false] then SourceControl::Git.new(:path => path)
when [false, true, false, false] then SourceControl::Subversion.new(:path => path)
when [false, false, true, false] then SourceControl::Mercurial.new(:path => path)
@cgriego
cgriego / snippet.txt
Created December 26, 2008 22:30
Testing to see if different script[type] values result in executed JavaScript.
<script type="text/javascript">/* <![CDATA[ */
var types = [
'text',
'application'//,
];
var subtypes = [
'javascript',
'jscript',
'ecmascript',