Skip to content

Instantly share code, notes, and snippets.

View scottbartell's full-sized avatar
👋

Scott Bartell scottbartell

👋
View GitHub Profile
@kreo
kreo / css-ios-pwa-viewport.css
Created January 28, 2022 16:18 — forked from cvan/css-ios-pwa-viewport.css
CSS for env(safe-area-inset-top) for iOS "Add to Homescreen" / PWA; standalone styles
@supports (padding-top: constant(safe-area-inset-top)) {
body {
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
}
@media (display-mode: fullscreen) {
body {
padding: 0;
}
-- Author: Krisjan Oldekamp
-- https://stacktonic.com/article/enrich-a-single-customer-view-with-google-analytics-4-big-query-data
declare lookback_window int64 default 365; -- how many days to lookback into the ga4 dataset to calculate profiles
-- udf: channel grouping (you could put this in a permanent function)
-- also see https://stacktonic.com/article/google-analytics-4-and-big-query-create-custom-channel-groupings-in-a-reusable-sql-function
create temporary function channel_grouping(tsource string, medium string, campaign string) as (
case
when (tsource = '(direct)' or tsource is null)
@krisjan-oldekamp
krisjan-oldekamp / google_analytics_bigquery_user_mapping_table_customer.sql
Last active June 12, 2024 13:12
How to create a user mapping table (or Identity Graph) based on all the available user identifiers in the Google Analytics 4 BigQuery exports (like device-IDs or customer-IDs). Full article on stacktonic.com
-- Author: Krisjan Oldekamp
-- https://stacktonic.com/article/create-a-user-mapping-table-based-on-the-google-analytics-4-big-query-dataset
declare lookback_window int64 default 90; -- how many days to lookback into the dataset to search for ids (compared to today)
-- udf: deduplicate array of struct
create temp function dedup(arr any type) as ((
select
array_agg(t)
from (
@tedgonzalez
tedgonzalez / AppStoreConnectRoles.md
Last active November 11, 2024 10:05
Ever since the Apple developer portal and App Store Connect merged, I got confused with the summary. I like knowing the diff between App Store Connect roles. Here's a detailed list of what each role can do:

App Store Connect Roles

Developer Developer with certificates AppManager AppManager with certificates Admin Account Holder
App Features
Upload Builds
Edit App Store Details (Read)
Create Apps and Submit Versions
@colinfwren
colinfwren / iOSExpoClientSetup.js
Created August 12, 2020 21:06
Launching the Expo Client on iOS
import {remote} from "webdriverio";
const capabilities = {
platformName: 'iOS',
platformVersion: '13.6',
deviceName: 'DEVICE_NAME', // Change this to the device you want to run
automationName: 'XCUITest',
bundleId: 'com.apple.mobilesafari',
autoAcceptAlerts: true,
};
@patmigliaccio
patmigliaccio / install-cf-gae-ssl.md
Last active November 4, 2024 13:51
Configuring Cloudflare SSL/TLS certificates on Google App Engine

Configuring Cloudflare SSL/TLS on Google App Engine

Implementing end-to-end HTTPS encryption with CloudFlare for Google App Engine applications.

Google App Engine - Custom Domains

Add Domains

Register the root domain with Google Cloud Platform at the following:

@cvan
cvan / css-ios-pwa-viewport.css
Created April 3, 2020 22:14
CSS for env(safe-area-inset-top) for iOS "Add to Homescreen" / PWA; standalone styles
@supports (padding-top: constant(safe-area-inset-top)) {
body {
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
}
@media (display-mode: fullscreen) {
body {
padding: 0;
}
@drovani
drovani / auth0-rule-shopify-multipass.js
Last active September 25, 2024 00:24
Auth0 Rule to Generate a Multipass token and redirect the user back to the Shopify store
function (user, context, callback) {
if (context.clientMetadata && context.clientMetadata.shopify_domain && context.clientMetadata.shopify_multipass_secret)
{
const RULE_NAME = 'shopify-multipasstoken';
const CLIENTNAME = context.clientName;
console.log(`${RULE_NAME} started by ${CLIENTNAME}`);
const now = (new Date()).toISOString();
let shopifyToken = {
email: user.email,
require('expect-puppeteer');
const isCI = require('is-ci');
const path = require('path');
const { mkdirp, writeFile } = require('fs-extra');
const screenshotsPath = path.resolve(__dirname, '../reports/screenshots');
const toFilename = s => s.replace(/[^a-z0-9.-]+/gi, '_');
@LeZuse
LeZuse / stats_logger.rb
Last active June 21, 2021 13:53
Puma plugin for stats logging on Heroku
Puma::Plugin.create do
def production?
ENV.fetch('RACK_ENV', 'development') == 'production'
end
def log(msg)
if production?
Rails.logger.info msg
else
puts msg