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
SELECT | |
last as last_month, | |
DATETIME_DIFF(last, first, MONTH) as retained_months, | |
COUNT(*) as users | |
FROM ( | |
SELECT | |
DATE(DATE_TRUNC(TIMESTAMP_MICROS(min(event_timestamp)), MONTH)) as first, | |
DATE(DATE_TRUNC(TIMESTAMP_MICROS(max(event_timestamp)), MONTH)) as last | |
FROM `<your-project>.events_*` | |
WHERE event_name = 'view_item' |
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
SELECT | |
case user.value.string_value | |
when '0' then 'Baseline' | |
when '1' then 'Other version' | |
else 'Error' | |
end as experiment_value, | |
count(distinct(user_pseudo_id)) as users, | |
count(*) as events, | |
(count(*) / count(distinct(user_pseudo_id))) as ratio | |
FROM `<project_name>.analytics_<id>.events_*`, |
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 'package:flutter/material.dart'; | |
void main() => runApp(ExampleApp()); | |
class ExampleApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Floating overlay example', | |
debugShowCheckedModeBanner: false, |
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
select | |
platform, | |
avg(p.value.double_value) as avg_value, | |
count(distinct(user_pseudo_id)) as views, | |
DATE_TRUNC(DATETIME(TIMESTAMP_MICROS(event_timestamp)), MONTH) as month | |
FROM `<project>.analytics_<id>.events_*`, | |
unnest(event_params) p | |
where event_name = 'view_item' and p.key = 'value' | |
group by month, platform | |
order by month, platform |
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
SELECT | |
all_users.platform, | |
all_users.event_date, | |
views.item_views / all_users.unique_users as searches_per_user | |
FROM ( | |
SELECT | |
platform, | |
count(distinct(user_pseudo_id)) as unique_users, | |
event_date | |
FROM `<project-id>.analytics_<id>.events_*` |
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
select | |
platform, | |
DATE_TRUNC(DATETIME(TIMESTAMP_MICROS(event_timestamp)), WEEK(SATURDAY)) as week_start, | |
count(distinct(user_pseudo_id)) as unique_users | |
FROM `<project-name>.analytics_<id>.events_*` | |
group by week_start, platform | |
order by week_start asc |
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
void registerRoutes() { | |
// ... | |
final useNewArticlePage = isDebugMode == true; | |
if (useNewArticlePage) { | |
routing.register(Routes.Article, (context, param) => FixedSizeArticlePage()); | |
} else { | |
routing.register(Routes.Article, (context, param) => ArticlePage()); | |
} | |
// .... | |
} |
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
cache: | |
paths: | |
- $CI_PROJECT_DIR/.pub-cache/ | |
build: | |
image: greycastle/flutter:2.2.3 | |
script: | |
- export PUB_CACHE=$CI_PROJECT_DIR/.pub-cache | |
- export PATH="$PATH":"$PUB_CACHE/bin" | |
- flutter pub get |
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
#!/bin/bash | |
# usage: | |
# chmod +x download.sh | |
# pbpaste | download.sh | |
# cat inputfile.txt | download.sh | |
# thanks to https://stackoverflow.com/a/7045517 | |
while read -r full_url |
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
_initRemoteConfig(ExperimentalMode experimentalMode) async { | |
final RemoteConfig remoteConfig = RemoteConfig.instance; | |
var cacheDuration = Duration(hours: 1); | |
// allows us to force update the cache even when we exit the experimental mode | |
if (experimentalMode.isExperimentalMode || experimentalMode.isConfigStale()) { | |
cacheDuration = Duration(seconds: 0); | |
} | |
experimentalMode.setConfigStale(false); | |
await remoteConfig.setConfigSettings(RemoteConfigSettings( |