Skip to content

Instantly share code, notes, and snippets.

@arkiver
arkiver / wedding_ivr.php
Created April 13, 2012 11:05 — forked from kookoolib/wedding_ivr.php
KooKoo Wedding IVR
<?php
session_start();
require_once("response.php");//response.php is the kookoo xml preparation class file
$r = new Response();
$r->setFiller("yes");
$recore_wav="update";
if(isset ($_REQUEST['event']) && $_REQUEST['event']== "NewCall" )
{
$_SESSION['caller_number']=$_REQUEST['cid'];
$_SESSION['kookoo_number']=$_REQUEST['called_number'];
@arkiver
arkiver / capybara cheat sheet
Created September 10, 2012 11:24 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@arkiver
arkiver / rails-jsonb-queries
Created January 13, 2021 19:15 — forked from mankind/rails-jsonb-queries
Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")