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
defmodule TravelerWeb.SearchbarLive do | |
use TravelerWeb, :live_view | |
alias Phoenix.LiveView.JS | |
alias Traveler.Places | |
def mount(_params, _session, socket) do | |
socket = assign(socket, places: []) | |
{:ok, socket, layout: false} | |
end |
These snippets provide a foundation for starting and stopping supervision trees at runtime using feature flags (e.g. Launch Darkly).
Some things to note when adapting these snippets:
- application.ex needs to be adapted into an existing application. The important part is that each child spec provided is compliant, and that there is a feature flag (
ld_key
) specified. - As written, if a feature flag fails for some reason, it defaults to starting all children. There is room for adaptation here as needed.
- This implementation will still require a
FeatureFlags
module to be available that implementsis_on?/2
. Adjust as needed to accomodate your own feature flag setup.
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 the Hubspot NodeJS Client Library - this will allow us to use the HubSpot APIs | |
const hubspot = require('@hubspot/api-client'); | |
/* | |
This function is called when the custom code action is executed. It takes 2 arguements. The first is the event object which contains information on the currently enrolled object. | |
The second is the callback function which is used to pass data back to the workflow. | |
*/ | |
exports.main = (event, callback) => { | |
// Instantiate a new HubSpot API client using the HAPI key (secret) |
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
/* eslint-env node */ | |
const { Webpack } = require("@embroider/webpack"); | |
const variant = { | |
name: "dev", | |
runtime: "browser", | |
optimizeForProduction: false, | |
}; | |
const webpack = new Webpack( | |
__dirname, | |
__dirname + "/dist", |
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 { | |
timeout, | |
task | |
} from 'ember-concurrency'; | |
export class StateManager { | |
constructor() { | |
this.startExecution(); | |
} |
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
// UPDATE: don't use this. when it re-partitions the list when time moves forward, it does not correctly keep hashes | |
// Use a real merkle tree instead: https://gist.github.com/jlongster/f431b6d75ef29c1a2ed000715aef9c8c | |
import Timestamp from './timestamp'; | |
// This is a compact data structure that keeps track of a list of | |
// hashes (representing messages) over a range of time in order to | |
// figure out what has changed between clients, kinda like a Merkle | |
// tree. It creates "buckets" that represent different time ranges, | |
// and divides time into smaller buckets the more recent they are. The |
For Chrome Canary:
alias hydra='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --no-sandbox --js-flags="--user-data-dir=/tmp/profile --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces"'
For regular ol' Chrome:
Problem: Convert nested structs or nested encoded maps into a decoded map and remove keys with nil values.
Solution: Walk the structure and convert all structures to decoded map.
Before (nested struct):
%TopLevelStuct{
_type: "Purchase",
account_key: "ZBmrcY7sv47nCaZOx5TXBTJuazy"
NewerOlder