Assuming this table definition:
CREATE TABLE segments (segments_id serial PRIMARY KEY, payload jsonb);
With JSON values like this:
INSERT INTO segments (payload)
VALUES ('{
"a": [
{
"kind": "person",
ember new cms | |
ember generate model page navbar:string title:string body:string | |
import DS from 'ember-data'; | |
export default DS.Model.extend({ | |
navbar: DS.attr('string'), | |
title: DS.attr('string'), | |
body: DS.attr('string'), |
//https://github.com/maccman/abba/blob/master/app/assets/javascripts/client/index.coffee | |
var extend, getCookie, host, request, setCookie, | |
slice = [].slice; | |
host = function(url) { | |
var parent, parser; | |
parent = document.createElement('div'); | |
parent.innerHTML = "<a href=\"" + url + "\">x</a>"; | |
parser = parent.firstChild; | |
return "" + parser.host; |
#https://rforge.net/doc/packages/Deducer/likelihood.test.html | |
#http://www.pmc.ucsc.edu/~mclapham/Rtips/G%20test.txt | |
# Log-likelihood tests of independence & goodness of fit | |
# Does Williams' and Yates' correction | |
# does Monte Carlo simulation of p-values, via gtestsim.c | |
# | |
# G & q calculation from Sokal & Rohlf (1995) Biometry 3rd ed. | |
# TOI Yates' correction taken from Mike Camann's 2x2 G-test fn. | |
# GOF Yates' correction as described in Zar (2000) |
#http://www.stat.wisc.edu/~st571-1/gtest.R | |
#see page 2 for data & page 17 for g-test http://www.stat.wisc.edu/~st571-1/06-tables-2.pdf | |
# Bret Larget | |
# October 28, 2010 | |
# September 30, 2011 | |
# Use source() to read this file into R to use it. | |
# Example: |
Deploying a simple Rails application with AWS Elastic Beanstalk by Julien SIMON, Principal Technical Evangelist @ Amazon Web Services | |
18/02/2016 | |
http://www.slideshare.net/JulienSIMON5/deploying-a-simple-rails-application-with-aws-elastic-beanstalk | |
1. . Create a Git repository with AWS CodeCommit | |
$ aws codecommit create-repository --repository-name blog --region us-east-1 --repository-description "ElasticBeanstalk demo" | |
$ git clone ssh://git-codecommit.us- east-1.amazonaws.com/v1/repos/blog | |
2. Create a new Rails application |
Getting started aws ses | |
http://codechannels.com/video/amazonwebservices/cloud/getting-started-with-amazon-ses/ | |
1. Verify email address | |
In the sandbox you can send email only from emails yiu have verified. | |
Go to email AWS SES then on the left clcik on 'verified senders' | |
to start the verification process: | |
a. click 'verify a ne sender' | |
in the dialogue box add your email and click submit. you will receive |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title> User define form element Example </title> | |
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.23.1.css"> | |
<style> | |
#div1 { |
Assuming this table definition:
CREATE TABLE segments (segments_id serial PRIMARY KEY, payload jsonb);
With JSON values like this:
INSERT INTO segments (payload)
VALUES ('{
"a": [
{
"kind": "person",
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") |