Skip to content

Instantly share code, notes, and snippets.

View paul's full-sized avatar

Paul Sadauskas paul

View GitHub Profile
Dir["files/default/keys/*"].each do |key_file|
execute "add key #{File.basename(key_file)}" do
command %{cat #{key_file} >> #{authorized_keys}}
not_if %{grep -qf #{key_file} #{authorized_keys}}
end
end
class Escalation
scope :active, where(:current_escalation_state_id => EscalationState.active)
def self.visible_to(account)
where(:escalation_definition_id => EscalationDefinition.visible_to(account))
end
end
__END__
!app_name
*.info -/var/log/app_name/rails.log
& @<%= log_server_ip %>
& ~
vendor/ruby
.bundle
*.rbc
@paul
paul / gog.com download.js
Created October 23, 2010 21:37
Download everything you've bought on GOG.com
// Paste this into firebug
$("div.sh_o_i_row[onclick^='window.top.location']").each(function() {
var string = String(this.onclick);
href = string.match(/http:[^"]+/)[0];
$(this).append("<a href=" + href + "/>");
});
// Then use downthemall to download everything on that page, filter with "/en/download"
Selector: dd.foo
<dd class="foo">Value</dd>
<dd class="foo">Trying to select this dd</dd>
Selector: dd:last
<dd class="other">Other Value</dd>
Selector: dd.foo:last-child
Selector: dd.foo:last-of-type
Selector: dd.foo
<dd class="foo">Value</dd>
<dd class="foo">Trying to select this dd</dd>
Selector: dd:last
<dd class="other">Other Value</dd>
Selector: dd.foo:last-child
Selector: dd.foo:last-of-type
require 'nokogiri'
doc = <<-DOC
<dl>
<dt>Label</dd>
<dd class=other>Other Value</dd>
<dt>Label</dt>
<dd class=foo>Value</dd>
<dd class=foo>Trying to select this dd</dd>
directory app_path do
owner node[:user]
group "ssbe"
mode "0775"
recursive true
end
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for collectd -n 4.10.1.165.g2047b2b
.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##