This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'riak/client/http_backend' | |
require 'riak/failed_request' | |
module Riak | |
class Client | |
# Uses the Ruby standard library Net::HTTP to connect to Riak. | |
# Conforms to the Riak::Client::HTTPBackend interface. | |
class NetHTTPTimeoutBackend < HTTPBackend | |
def self.configured? | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ripple/associations/proxy' | |
require 'ripple/associations/one' | |
module Ripple | |
module Associations | |
class OneKeyProxy < Proxy | |
include One | |
def replace(doc) | |
@reflection.verify_type!(doc, owner) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(pbstream). | |
-export([load/1, keys/0, bucket/0, map/3, pb_link/0, pb_link/2]). | |
-define(QUERY, [{map, {modfun, riak_kv_mapreduce, map_object_value}, <<"filter_notfound">>, true}]). | |
load(HowMany) -> | |
lists:foreach(fun(Index) -> | |
BIndex = list_to_binary(integer_to_list(Index)), | |
RObj = riakc_obj:new(<<"examples">>, <<"key",BIndex/binary>>, <<"Value ",BIndex/binary>>), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(localstream). | |
-export([load/1, keys/0, bucket/0, map/3]). | |
-define(QUERY, [{map, {modfun, localstream, map}, none, true}]). | |
load(HowMany) -> | |
{ok, Client} = riak:local_client(), | |
lists:foreach(fun(Index) -> | |
BIndex = list_to_binary(integer_to_list(Index)), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/riak/erts-5.7.5/bin/erl -noshell -name [email protected] -setcookie riak -eval "riak_kv_backup:backup('[email protected]', \"/path/to/backup-file.riak\", \"all\")" -s init stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-# 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| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Feel free to change any of the following variables for your app: | |
TIMEOUT=${TIMEOUT-60} | |
APP_ROOT=/home/deploy/taxscribe/current | |
PID=$APP_ROOT/tmp/pids/unicorn.pid | |
CMD="/usr/local/bin/unicorn --config-file $APP_ROOT/config/unicorn.server.rb --env production --daemonize $APP_ROOT/config.ru" | |
action="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* autocleaning attributes */ | |
var cleaner = {}; | |
cleaner.phone = function(){ | |
var regex = /[^0-9x]/g; | |
var value = $(this).val(); | |
if (regex.test(value)) { | |
$(this).val(value.replace(regex, '')); | |
} | |
}; | |
cleaner.date = function(){ |