Skip to content

Instantly share code, notes, and snippets.

View adamhunter's full-sized avatar

Adam Hunter adamhunter

View GitHub Profile
-# where pages = that_example_hash[:pages]
- pages.each do |page|
.image
%img{ :src => "#{page[:image]}" }
-# the x & y coorinants for the top, left corners have some simple logic to subtract 2 from each to counter
-# the 2px border that's added in the CSS. This makes the focus areas overlay the main image in the right spot.
-# pages.each_pair do ||
- page[:tooltips].each do |tooltip|
:pages =>[{
:name=>"page-1",
:image=>"/pres/images/filler-image.jpg",
:tooltips=>
[{:tooltip=>"focus-1",
:focusY=>45,
:content=>"Lorem ipsum ",
:placement=>"top-left",
:focusHeight=>23,
:x=>20,
#!/bin/sh
set -u
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
APP_ROOT=/home/deploy/public_html/rm/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
ENV=production
<?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.195 0.195 0.195</string>
<key>InsertionPoint</key>
<string>0.902 0.902 0.902</string>
adamhunter # i have three nodes in a cluster, how do i remove a node from a cluster?
seancribbs # adamhunter: I had one hang on me earlier, thought it was just Ruby
jlee # adamhunter: are you trying to simulate a failure, or scale the cluster down to two node permanently?
adamhunter # i am trying to figure out if the other two nodes are messing up the first
seancribbs # adamhunter: 0.9?
adamhunter # yeah
seancribbs # use riak_connect:remove_from_cluster/1 in the console, then wait for the handoff to finish
Damm joined #riak
Apr 22 14:52
adamhunter # i clearly must have done something wrong when i installed :) it doesn't work on any of my three nodes, tks
#! /bin/bash
### BEGIN INIT INFO
# Provides: riak
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
# Config for Nginx to act as a front-end for Riak
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc)
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_)
# Config is in /etc/nginx/sites-available/default or somewhere like that
# Set up load-balancing to send requests to all nodes in the Riak cluster
# Replace these IPs/ports with the locations of your Riak nodes
upstream riak_hosts {
server 127.0.0.1:8098;
# If your workers are inactive for a long period of time, they'll lose
# their MySQL connection.
#
# This hack ensures we re-connect whenever a connection is
# lost. Because, really. why not?
#
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar)
#
# From:
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/
@adamhunter
adamhunter / ruby-riak
Created February 19, 2010 14:34 — forked from bigfleet/ruby-riak
#!/bin/bash
# On OS X? Installed homebrew already? Interested in Riak? Get familiar!
# This command in your terminal should be a one-stop shop.
# curl http://gist.github.com/raw/308745/107168665a46decd540dd1c5d50ccdd82eb01051/ruby-riak | sh
brew install erlang wget
curl http://bitbucket.org/basho/riak/get/riak-0.8.tar.gz | tar zx
cd riak && make all rel
cd rel/riak && bin/riak start
wget http://bitbucket.org/basho/riak/raw/67c55dfd44f5/client_lib/jiak.rb
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests