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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Colors</key> | |
<dict> | |
<key>Background</key> | |
<string>0.082 0.087 0.109</string> | |
<key>InsertionPoint</key> | |
<string>1.000 1.000 1.000</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
# Put this in nrpe.cfg on the remote host you're monitoring. | |
command[check_load]=/usr/local/nagios/libexec/check_load -w 5,4,3 -c 10,8,6 | |
command[check_memory]=/usr/local/nagios/libexec/check_mem.pl -f -w 5 -c 2 | |
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p / | |
command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10% | |
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z | |
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200 | |
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10 |
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
jQuery.fn.bind = function (bind) { | |
return function () { | |
console.count("jQuery bind count"); | |
console.log("jQuery bind %o", this); | |
return bind.apply(this, arguments); | |
}; | |
}(jQuery.fn.bind); |
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
var = :foo | |
%w(a b c).each do |var| | |
# Do something. | |
end | |
puts var # var is actually "c", not :foo. This is not a problem in Ruby 1.9 onwards. |
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
static NSString *CellIdentifier = @"Cell"; | |
cell = (MyCustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) { | |
NSArray *nibContents = [[NSBundle mainBundle] loadNibNamed:@"TableCell" owner:self options:nil]; | |
cell = [nibContents objectAtIndex:0]; | |
} | |
// do your customization | |
return cell; |
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
./scan-build -k -V -o foo/ xcodebuild -configuration Debug -sdk iphonesimulator3.0 |
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
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("friendfeed.com") { | |
body,input.l_toinput { | |
background-color: #202420!important; | |
color: #fff!important; | |
} | |
div.comments { | |
color: #eaeaea!important; |
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
builder = Nokogiri::XML::Builder.new do |xml| | |
xml.listings { | |
xml.language 'en' | |
properties.each do |property| | |
xml.listing { | |
# Instantiate a Nokogiri::XML::Node and insert it manually. | |
node = Nokogiri::XML::Node.new('id', doc) # doc is actually Nokogiri::XML::Builder#doc. | |
node.content = property.id |
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
function foo() { | |
if (!arguments.callee.done) { | |
arguments.callee.done = true; | |
} else { | |
return; | |
} | |
// Actual code here. | |
} |