If you use atom... download & install the following packages:
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
with fake_data as ( | |
/* Generate 10 fake users and many audiences */ | |
select | |
uniform(1, 10, random()) as user_id, | |
'a-' || substr(uuid_string(), 1, 5) as audience_id | |
from table(generator(rowcount => 500)) | |
order by 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
// Handler function, invoked on every identify event | |
// Argument: event = event payload, settings = function settings, as of Jan 2020 it provides access to API Key value. | |
// Step 1. Invoke func on identify event | |
async function onIdentify(event, settings) { | |
event.traits = event.traits || {}; | |
var email = event.traits.email; // Step 2. Pick up email from 'traits' obj of the incoming event | |
var user_id = event.userId; // Pick up userId from the incoming event | |
// Step 3. Make HTTP request to Profile API with the email from previous step | |
// You can use userId value instead of email as a lookup field. In this case, insert "user_id:${userId_variable_name}" in Profile API URL instead of "email:${email_variable_name}" | |
// Note '?' parameters. You can omit 'include' parameter to return all traits from the profile. 'Limit' parameter defines how many traits is returned in JSON. |
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
// ex 1: | |
render(){ | |
return ( | |
<Component children={(val) => <ChildComponent value={val} />} /> | |
) | |
} | |
// ex 2: | |
render() { | |
return ( |
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
import React from 'react'; | |
import { | |
convertFromRaw, | |
EditorState, | |
} from 'draft-js'; | |
import DraftJSPluginsEditor from 'draft-js-plugins-editor'; | |
import createMentionPlugin from 'draft-js-mention-plugin'; | |
import { fromJS } from 'immutable'; | |
import forEach from 'lodash/forEach'; |
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
location = /status { | |
return 200; | |
access_log off; | |
} | |
} | |
server { |
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
test: | |
cp ~/.npmrc .npmrc |