Skip to content

Instantly share code, notes, and snippets.

include_recipe "collectd"
class ChefCollectdPluginReportHandler < Chef::Handler
def report
Chef::Log.info('Running collectd hander')
node[:last_success_time] = Time.now.to_f
node[:error_count_since_success] = 0
node.save
end
end
@coderanger
coderanger / spng_-_hobopolis_manager.user.js
Created December 15, 2010 20:14
Updated version of the SPNG RaidManager to display Uncle Hobo and Sorority House loot
// SPNG Raid Manager
// Questions, comments, bug reports or donations to: magnet0
//
// Updated points values and current maintenance handled by magnet0
//
// ==UserScript==
// @name SPNG - hobopolis manager
// @namespace http://userscripts.org/scripts/source/86676.user.js
// @description Version 2.41 - modifed from slyz version of Dr3v1's Raid Log Manager
// @include *kingdomofloathing.com/topmenu.php*
import inspect
from django import forms
from django.contrib.auth.forms import UserChangeForm
from django.contrib.auth.models import User
from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404
from django.utils.datastructures import SortedDict
import nexus
action :append do
execute "cat #{new_resource.line} >>#{new_resource.path}" do
not_if "grep '#{new_resource.line}' #{new_resource.file}"
end
end
@coderanger
coderanger / git_plugin.py
Created February 16, 2011 00:21
Display the git branch of the file in the status bar
import itertools
import sublime
import sublime_plugin
import os
import subprocess
import threading
import time
def remove_longest_substring(s1, s2):
for i, (c1, c2) in enumerate(itertools.izip_longest(s1, s2)):
from django import forms
from django.core.exceptions import ValidationError
from commis.api.cookbook.models import CookbookRecipe
from commis.api.node.models import Node
from commis.api.role.models import Role
class MultipleChoiceAnyField(forms.MultipleChoiceField):
"""A MultipleChoiceField with no validation."""
r = gem_package "amazon-ec2" do
version "0.9.17"
end
r.run_action(:install)
require 'rubygems'
Gem.clear_paths
require 'AWS'
ruby_block "register_with_elb" do
#
# This is the template file
#
<Port <%= @port %> >
# bla bla bla
</Port>
#
# The problem is I get several files; port_80.conf port_8080.conf, ... port_8888.conf
@coderanger
coderanger / How-to-use
Created September 2, 2011 18:07
Debug bootstrap template
Install to ~/.chef/bootstrap/ubuntu10.04-gems-debug.erb and then add "-d ubuntu10.04-gems-debug" to the end of your bootstrap or server create command.
@coderanger
coderanger / _grid.scss
Created March 30, 2012 23:25
Local grid support for Susy
@import "susy";
$grid-info-stack: ();
@function _stack_push($list, $item) {
@return join($item, $list);
}
@function _stack_top($list) {
@return nth($list, 1);