Skip to content

Instantly share code, notes, and snippets.

<?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>
# 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
@chuyeow
chuyeow / jQuery event binding count.js
Created November 5, 2009 07:42
Good for checking number of event bindings in place when using jQuery. From http://ajaxian.com/archives/jquery-bondage
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);
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.
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;
./scan-build -k -V -o foo/ xcodebuild -configuration Debug -sdk iphonesimulator3.0
@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;
// Clear newsletter textbox on focus if it contains the default text.
$('#newsletter_email').focus(function() {
var value = $(this).val();
// Clear the textbox if it's the default value.
if (!$(this).data('default') || value == $(this).data('default')) {
$(this).data('default', value);
$(this).val('');
}
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
function foo() {
if (!arguments.callee.done) {
arguments.callee.done = true;
} else {
return;
}
// Actual code here.
}