# Use Chef resources in an application via solo mode. | |
# Could also be configured in client mode, and then use a server. | |
require 'rubygems' | |
require 'chef' | |
require 'chef/client' | |
require 'chef/run_context' | |
Chef::Config[:solo] = true | |
Chef::Config[:log_level] = :info |
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf | |
# /opt/local/share/doc/tmux/vim-keys.conf | |
# | |
# URLs to read: | |
# |
class Chef | |
class Provider | |
class RemoteS3File < Chef::Provider::RemoteFile | |
def load_current_resource | |
super | |
%w{bucket object_name aws_access_key_id aws_secret_access_key}.map do |attribute| | |
Chef::Application.fatal! "remote_s3_file: required attr: #{attribute} is nil", -92 if | |
@new_resource.send(attribute.to_sym).nil? | |
end |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'chef' | |
require 'chef/client' | |
require 'chef/run_context' | |
Chef::Config[:solo] = true | |
Chef::Config[:log_level] = :info | |
Chef::Log.level(:info) |
current_dir = File.dirname(__FILE__) | |
platform = "https://api.opscode.com/organizations" | |
require 'grit' | |
branch = Grit::Repo.new("#{current_dir}/..").head.name | |
case branch | |
when "internal" | |
url = "http://virt1test.int.example.org:4000" | |
validator = "" |
Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down
One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.
Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o
sysadmins = search(:users, 'groups:sysadmin') | |
sysadmin_group = Array.new | |
sysadmins.each do |u| | |
sysadmin_group << u['id'] | |
u['openid'].each do |oid| | |
node[:apache][:allowed_openids] << oid unless node[:apache][:allowed_openids].include?(oid) | |
end if u['openid'] |