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
export type Side = 'top' | 'right' | 'bottom' | 'left'; | |
export interface CanvasData { | |
nodes: (CanvasFileData | CanvasTextData | CanvasLinkData)[]; | |
edges: CanvasEdgeData[]; | |
} | |
export interface CanvasNodeData { | |
id: string; | |
x: number; |
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
-- Based on: https://medium.com/quick-code/how-to-write-sql-to-calculate-user-cohort-retention-a1b3b57c7a2f | |
-- Uses DATE_PART instead of DATE_DIFF as it is not supported by PostgreSQL | |
-- (branch_id, scheduled_for, total_cents) | |
WITH activities AS ( | |
SELECT branch_id, scheduled_for, total_cents | |
FROM orders | |
WHERE orders.status = 'complete' | |
), | |
-- (branch_id, cohort_month): cohort month is the first order date |
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
class MyPlugin extends BasePlugin | |
{ | |
// ... | |
public function searchPlus_addAlgoliaMapping() | |
{ | |
return [ | |
[ | |
'name' => 'My Basic Mapping', |