This file contains hidden or 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
defmodule NodeTest do | |
use ExUnit.Case | |
test "can have childen and parents" do | |
node1 = %Node{name: "parent"} |> Repo.insert | |
node2 = %Node{name: "child2"} |> Repo.insert | |
%NodeToNode{parent_id: node1.id, child_id: node.id} |> Repo.insert | |
assert Node.get_children(node1) == [node2] | |
assert Node.get_parents(node2) == [node1] | |
end |
This file contains hidden or 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
var https = require('https'); | |
var util = require('util'); | |
exports.handler = function(event, context) { | |
console.log(JSON.stringify(event, null, 2)); | |
console.log('From SNS:', event.Records[0].Sns.Message); | |
var postData = { | |
"channel": "#aws-sns", | |
"username": "AWS SNS via Lamda :: DevQa Cloud", |
This file contains hidden or 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
CREATE TABLE IF NOT EXISTS stopwords ( | |
word VARCHAR(20) NOT NULL; | |
); | |
CREATE OR REPLACE FUNCTION remove_stopwords(string TEXT, OUT tsv TSVECTOR) AS | |
$$ | |
BEGIN | |
SELECT string_agg(words.*, ' ')::tsvector FROM | |
-- split tsvector into row for each word | |
regexp_split_to_table( |
OlderNewer