Skip to content

Instantly share code, notes, and snippets.

def event(conn, params) do
user_token = params["authentications"]["account"]["token"]["token"]
response =
build_response(conn, user_token)
|> Jason.encode!()
conn
|> put_resp_content_type("application/json")
|> send_resp(200, response)
%{
"install" => %{
"active" => true,
"amount" => 0,
"appId" => "local",
"created" => nil,
"deactivatedAt" => nil,
"deleted" => false,
"id" => "FJj9ri2UtwIv",
"installerUserId" => "",
%{
"app" => %{
"adminVisible" => false,
"agreements" => nil,
"alias" => "",
"author" => "",
"categoryIds" => nil,
"codeVersion" => "",
"color" => "",
"created" => nil,
@chasers
chasers / deep-merge-test.ex
Created April 11, 2019 12:59
Deep Merge Test
defmodule Logflare.DeepMergeTest do
# this works: DeepMerge.deep_merge(%{a: %{b: 1}, c: [d: 1]}, %{a: %{z: 5}, c: [x: 0]})
def merge() do
DeepMerge.deep_merge(newschema().fields, oldschema().fields)
end
def newschema do
%{
fields: [
@chasers
chasers / al-json-serp-ads.json
Created March 6, 2012 22:46
AuthorityLabs JSON Google SERP with Ads
{
"total_number_of_results": 47300000,
"blog_posts": false,
"video_packs": [
33
],
"invalid_term": false,
"integrated_places": false,
"rank_date": "2012-03-06",
"data_center": "us",
@chasers
chasers / al-papi-web-insights-json.json
Created May 10, 2012 18:27
AuthorityLabs Web Insights JSON
{
"results": {
"page_data": {
"h2_tags": [
{
"text": "‘Walk the Plank’ Unconference"
}
],
"image_tags": [
{
@chasers
chasers / yahoo-papi-locales.json
Created April 11, 2012 20:49 — forked from authoritylabs/yahoo-papi-locales.json
AuthorityLabs Supported Yahoo! Partner API Locales
{
"locales": {
"es-us": {
"tld": "espanol.search.yahoo.com",
"description": "United States - Spanish"
},
"en-tw": {
"tld": "tw.search.yahoo.com",
"description": ""
},
@chasers
chasers / bing-papi-locales.json
Created April 11, 2012 20:51 — forked from authoritylabs/bing-papi-locales.json
AuthorityLabs Supported Bing Partner API Locales
{
"locales": {
"ko-kr": {
"tld": "http://bing.com/?setmkt=ko-jr&setlang=match",
"description": "Korea - Korean"
},
"it-it": {
"tld": "http://bing.com/?setmkt=it-it&setlang=match",
"description": "Italy - Italian"
},
@chasers
chasers / al-json-serp-local_pack.json
Created March 28, 2012 18:42
AuthorityLabs JSON Google SERP with local_pack Results
{
"total_number_of_results": 663000,
"blog_posts": false,
"video_packs": [],
"invalid_term": false,
"integrated_places": false,
"rank_date": "2012-03-28",
"data_center": "us",
"s3_key": "",
"_id": "4f735025009e6123a3000008",
@chasers
chasers / al-json-serp-brandpack-local.json
Created March 10, 2012 21:02
AuthorityLabs JSON SERP with Brand Pack & Traditional Local Pack
{
"total_number_of_results": 3240000,
"blog_posts": false,
"video_packs": [],
"invalid_term": false,
"integrated_places": false,
"rank_date": "2012-03-09",
"data_center": "us",
"s3_key": "",
"_id": "4f5a6ef785d6691eec00004c",